summaryrefslogtreecommitdiff
path: root/original.go
blob: 7663e5e929473cf9fe8465a4fc8baa5af7c5f102 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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...)
}