Documentation
¶
Index ¶
- Variables
- func Debug(msg string)
- func Debugf(template string, args ...interface{})
- func Error(msg string)
- func Errorf(template string, args ...interface{})
- func Info(msg string)
- func Infof(template string, args ...interface{})
- func InitLogger(appName string, instanceID string, level string, dir string, color bool, ...) error
- func KoinosColorLevelEncoder(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
- func KoinosLevelEncoder(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
- func KoinosTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
- func NewKoinosEncoder(cfg zapcore.EncoderConfig, appID string) zapcore.Encoder
- func Warn(msg string)
- func Warnf(template string, args ...interface{})
- type KoinosEncoder
Constants ¶
This section is empty.
Variables ¶
var (
// GetPool retrieves a buffer from the pool, creating one if necessary.
GetPool = _pool.Get
)
Functions ¶
func Debugf ¶
func Debugf(template string, args ...interface{})
Debugf logs to the debug level with a format string and associated parameters
func Errorf ¶
func Errorf(template string, args ...interface{})
Errorf logs to the error level with a format string and associated parameters
func Infof ¶
func Infof(template string, args ...interface{})
Infof logs to the info level with a format string and associated parameters
func InitLogger ¶
func InitLogger(appName string, instanceID string, level string, dir string, color bool, datetime bool) error
InitLogger initializes the logger with the given parameters
func KoinosColorLevelEncoder ¶
func KoinosColorLevelEncoder(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
KoinosColorLevelEncoder implements the Koinos log level color encoding standard
func KoinosLevelEncoder ¶
func KoinosLevelEncoder(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
KoinosLevelEncoder implements the Koinos log level encoding standard
func KoinosTimeEncoder ¶
func KoinosTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
KoinosTimeEncoder encodes timestamps in the Koinos human-readable log standard
func NewKoinosEncoder ¶
func NewKoinosEncoder(cfg zapcore.EncoderConfig, appID string) zapcore.Encoder
NewKoinosEncoder creates and returns a new instance of KoinosEncoder
Types ¶
type KoinosEncoder ¶
type KoinosEncoder struct { *zapcore.MapObjectEncoder *zapcore.EncoderConfig ConsoleSeparator string AppID string }
KoinosEncoder implements custon koinos log formatting
func (*KoinosEncoder) Clone ¶
func (ke *KoinosEncoder) Clone() zapcore.Encoder
Clone clones KoinosEncoder
func (*KoinosEncoder) EncodeEntry ¶
func (ke *KoinosEncoder) EncodeEntry(ent zapcore.Entry, fields []zapcore.Field) (*buffer.Buffer, error)
EncodeEntry encodes the given entry data