segment-boneyard / go-log

Go core-like logger with levels and default logger
58 stars 5 forks source link

consider implementing Output(int, string) error #5

Open gjohnson opened 9 years ago

gjohnson commented 9 years ago

So we can pass our logger to mongo, nsq, etc. Seems like most packages define their internal logger with:

interface Logger {
  Output(depth int, s string) error
}

http://golang.org/src/pkg/log/log.go?s=4418:4472#L120 https://github.com/bitly/nsq/blob/master/nsqd/logger.go https://github.com/go-mgo/mgo/blob/v2/log.go#L40-L42

tj commented 9 years ago

SGTM! might be nice to just "inherit" the stdlog via:

type Log struct {
  *std.Logger
}

just slap our junk on top