log/original.go

95 lines
1.8 KiB
Go
Raw Permalink Normal View History

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
*/
// TODO: fill in the other functions from "log". Is there a way to automagically do that?
// 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
*/
func Println(a ...any) {
if !PRINTLN.Ok() {
return
}
if !PRINTLN.b {
return
}
realPrintln(a...)
}
func Printf(s string, a ...any) {
if !PRINTLN.Ok() {
return
}
if !PRINTLN.b {
return
}
realPrintf(s, a...)
}
func Sprint(a ...any) string {
return realSprint(a...)
}
func Sprintf(s string, a ...any) string {
return realSprintf(s, a...)
}
func Sprintln(a ...any) string {
return realSprintln(a...)
}
func Fatalln(a ...any) {
realFatalln(a...)
}
func Fatalf(s string, a ...any) {
realFatalf(s, a...)
}
func Fatal(s string, a ...any) {
realFatalf(s, a...)
}