#680·zap

Support custom log levels/general logging.

Author: NathanZookCreated Feb 11, 2019Updated Dec 18, 2025

My company wants to implement a trace level log. Currently, this is problematic because zap.Logger.check is private.

Digging in, it would seem that a full implementation would extract https://github.com/uber-go/zap/blob/master/logger.go#L273-L282 into a method call. Of course, the natural target of the call is probably the levels themselves, which would be a problem. Making it a method on *zap.Logger would do, I think.

Ideally, we would probably want to change the zapcore.Level constants to variables, and implement a zap.Logger#Log method that takes a zapcore.Level as its second argument.

I know of one major user of Go that implements TRACE1, TRACE2, and TRACE3...