File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,21 @@ stdLogger.Printf("[DEBUG] %+v", stdLogger)
128
128
... [DEBUG] my-app: &{mu:{state:0 sema:0} prefix: flag:0 out:0xc42000a0a0 buf:[]}
129
129
```
130
130
131
+ Alternatively, you may configure the system-wide logger:
132
+
133
+ ``` go
134
+ // log the standard logger from 'import "log"'
135
+ log.SetOutput (appLogger.Writer (&hclog.StandardLoggerOptions {InferLevels: true }))
136
+ log.SetPrefix (" " )
137
+ log.SetFlags (0 )
138
+
139
+ log.Printf (" [DEBUG] %d " , 42 )
140
+ ```
141
+
142
+ ``` text
143
+ ... [DEBUG] my-app: 42
144
+ ```
145
+
131
146
Notice that if ` appLogger ` is initialized with the ` INFO ` log level _ and_ you
132
147
specify ` InferLevels: true ` , you will not see any output here. You must change
133
148
` appLogger ` to ` DEBUG ` to see output. See the docs for more information.
You can’t perform that action at this time.
0 commit comments