2023-12-31 10:45:04 -06:00
|
|
|
package log
|
|
|
|
|
|
|
|
/*
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
}
|
|
|
|
|
|
|
|
and
|
|
|
|
|
|
|
|
import (
|
|
|
|
"go.wit.com/log"
|
|
|
|
}
|
|
|
|
|
|
|
|
Should work exactly the same.
|
|
|
|
|
|
|
|
These are golang log functions that are not changed
|
|
|
|
at all. The arguments are all just passed straight through
|
|
|
|
so this package appears to work exactly like the original ones
|
|
|
|
*/
|
|
|
|
|
2024-01-04 12:34:04 -06:00
|
|
|
// TODO: fill in the other functions from "log". Is there a way to automagically do that?
|
2024-01-09 15:50:53 -06:00
|
|
|
// the full list is:
|
|
|
|
/*
|
|
|
|
type Logger
|
|
|
|
|
|
|
|
// NEED THESE
|
|
|
|
func (l *Logger) Fatal(v ...any)
|
|
|
|
func (l *Logger) Fatalf(format string, v ...any)
|
|
|
|
func (l *Logger) Fatalln(v ...any)
|
|
|
|
func (l *Logger) Panic(v ...any)
|
|
|
|
func (l *Logger) Panicf(format string, v ...any)
|
|
|
|
func (l *Logger) Panicln(v ...any)
|
|
|
|
func (l *Logger) Print(v ...any)
|
|
|
|
func (l *Logger) Printf(format string, v ...any)
|
|
|
|
func (l *Logger) Println(v ...any)
|
|
|
|
|
|
|
|
func Default() *Logger
|
|
|
|
func New(out io.Writer, prefix string, flag int) *Logger
|
|
|
|
|
|
|
|
// what are these?
|
|
|
|
func (l *Logger) Flags() int
|
|
|
|
func (l *Logger) SetFlags(flag int)
|
|
|
|
func (l *Logger) Prefix() string
|
|
|
|
func (l *Logger) SetPrefix(prefix string)
|
|
|
|
|
|
|
|
// probably not this stuff
|
|
|
|
func (l *Logger) SetOutput(w io.Writer)
|
|
|
|
func (l *Logger) Output(calldepth int, s string) error
|
|
|
|
func (l *Logger) Writer() io.Writer
|
|
|
|
*/
|
|
|
|
|
2024-01-04 12:34:04 -06:00
|
|
|
|
2023-12-31 10:45:04 -06:00
|
|
|
import (
|
|
|
|
origlog "log"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Println(a ...any) {
|
2024-01-09 15:50:53 -06:00
|
|
|
if ! PRINTLN.Ok() { return }
|
|
|
|
if ! PRINTLN.b { return }
|
2023-12-31 10:45:04 -06:00
|
|
|
origlog.Println(a...)
|
|
|
|
}
|
|
|
|
|
|
|
|
func Printf(s string, a ...any) {
|
2024-01-09 15:50:53 -06:00
|
|
|
if ! PRINTLN.Ok() { return }
|
|
|
|
if ! PRINTLN.b { return }
|
2023-12-31 10:45:04 -06:00
|
|
|
origlog.Printf(s, a...)
|
|
|
|
}
|
|
|
|
|
2024-01-17 20:54:32 -06:00
|
|
|
func Fatalln(a ...any) {
|
|
|
|
origlog.Fatalln(a...)
|
|
|
|
}
|
|
|
|
|
2023-12-31 10:45:04 -06:00
|
|
|
func Fatalf(s string, a ...any) {
|
|
|
|
origlog.Fatalf(s, a...)
|
|
|
|
}
|
|
|
|
|
|
|
|
func Fatal(s string, a ...any) {
|
|
|
|
origlog.Fatalf(s, a...)
|
|
|
|
}
|