mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-10 00:29:01 +02:00
16 lines
249 B
Markdown
16 lines
249 B
Markdown
|
# Log
|
||
|
|
||
|
## Usage
|
||
|
|
||
|
### Structured logging
|
||
|
|
||
|
```
|
||
|
logger := stdlog.NewLogger(stdlog.Writer(os.Stdout))
|
||
|
log := log.NewHelper("module_name", logger)
|
||
|
// Levels
|
||
|
log.Info("some log")
|
||
|
log.Infof("format %s", "some log")
|
||
|
log.Infow("field_name", "some log")
|
||
|
```
|
||
|
|