This repository has been archived by the owner on Dec 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
logger.vt.funcs.go
136 lines (117 loc) · 4.18 KB
/
logger.vt.funcs.go
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
//go:build verbose
// +build verbose
package log
// VerboseEnabled identify whether `--tags=verbose` has been defined in go building
const VerboseEnabled = true
// VTracef prints the text to stdin if logging level is greater than TraceLevel
// It would be optimized to discard except `--tags=verbose` was been defined.
func VTracef(msg string, args ...interface{}) {
logger.Tracef(msg, args...)
}
// VDebugf prints the text to stdin if logging level is greater than DebugLevel
// It would be optimized to discard except `--tags=verbose` was been defined.
func VDebugf(msg string, args ...interface{}) {
logger.Debugf(msg, args...)
}
// VInfof prints the text to stdin if logging level is greater than InfoLevel
// It would be optimized to discard except `--tags=verbose` was been defined.
func VInfof(msg string, args ...interface{}) {
logger.Infof(msg, args...)
}
// VWarnf prints the text to stderr
// It would be optimized to discard except `--tags=verbose` was been defined.
func VWarnf(msg string, args ...interface{}) {
logger.Warnf(msg, args...)
}
// VErrorf prints the text to stderr
// It would be optimized to discard except `--tags=verbose` was been defined.
func VErrorf(msg string, args ...interface{}) {
logger.Errorf(msg, args...)
}
// VFatalf is equivalent to Printf() followed by a call to os.Exit(1).
// It would be optimized to discard except `--tags=verbose` was been defined.
func VFatalf(msg string, args ...interface{}) {
if InTesting() {
logger.Panicf(msg, args)
}
logger.Fatalf(msg, args...)
}
// VPanicf is equivalent to Printf() followed by a call to panic().
// It would be optimized to discard except `--tags=verbose` was been defined.
func VPanicf(msg string, args ...interface{}) {
logger.Panicf(msg, args...)
}
// VPrintf calls Output to print to the standard logger.
// Arguments are handled in the manner of fmt.Printf.
// It would be optimized to discard except `--tags=verbose` was been defined.
func VPrintf(msg string, args ...interface{}) {
logger.Printf(msg, args...)
}
// VTrace prints all args to stdin if logging level is greater than TraceLevel
// It would be optimized to discard except `--tags=verbose` was been defined.
func VTrace(args ...interface{}) {
if l := AsL(logger); l != nil {
l.Trace(args...)
}
}
// VDebug prints all args to stdin if logging level is greater than DebugLevel
// It would be optimized to discard except `--tags=verbose` was been defined.
func VDebug(args ...interface{}) {
if l := AsL(logger); l != nil {
l.Debug(args...)
}
}
// VInfo prints all args to stdin if logging level is greater than InfoLevel
// It would be optimized to discard except `--tags=verbose` was been defined.
func VInfo(args ...interface{}) {
if l := AsL(logger); l != nil {
l.Info(args...)
}
}
// VWarn prints all args to stderr
// It would be optimized to discard except `--tags=verbose` was been defined.
func VWarn(args ...interface{}) {
if l := AsL(logger); l != nil {
l.Warn(args...)
}
}
// VError prints all args to stderr
// It would be optimized to discard except `--tags=verbose` was been defined.
func VError(args ...interface{}) {
if l := AsL(logger); l != nil {
l.Error(args...)
}
}
// VFatal is equivalent to Printf() followed by a call to os.Exit(1).
// It would be optimized to discard except `--tags=verbose` was been defined.
func VFatal(args ...interface{}) {
if l := AsL(logger); l != nil {
if InTesting() {
l.Panic(args)
}
l.Fatal(args...)
}
}
// VPanic is equivalent to Printf() followed by a call to panic().
// It would be optimized to discard except `--tags=verbose` was been defined.
func VPanic(args ...interface{}) {
if l := AsL(logger); l != nil {
l.Panic(args...)
}
}
// VPrint calls Output to print to the standard logger.
// Arguments are handled in the manner of fmt.Print.
// It would be optimized to discard except `--tags=verbose` was been defined.
func VPrint(args ...interface{}) {
if l := AsL(logger); l != nil {
l.Print(args...)
}
}
// VPrintln calls Output to print to the standard logger.
// Arguments are handled in the manner of fmt.Println.
// It would be optimized to discard except `--tags=verbose` was been defined.
func VPrintln(args ...interface{}) {
if l := AsL(logger); l != nil {
l.Println(args...)
}
}