序
本文主要研究一下golang的log
![ec3cefb1b8efa772920301b058efc5a9.png](https://img-blog.csdnimg.cn/img_convert/ec3cefb1b8efa772920301b058efc5a9.png)
log
flags
const ( Ldate = 1 <
这几个flags可以用来设置log的pattern
logger
type Logger struct { mu sync.Mutex // ensures atomic writes; protects the following fields prefix string // prefix on each line to identify the logger (but see Lmsgprefix) flag int // properties out io.Writer // destination for output buf []byte // for accumulating text to write}func New(out io.Writer, prefix string, flag int) *Logger { return &Logger{out: out, prefix: prefix, flag: flag}}func (l *Logger) SetOutput(w io.Writer) {