Documentation
¶
Index ¶
- Constants
- func InitLogger(env LogLevel, processName ProcessName) error
- type LogLevel
- type Logger
- type ProcessName
- type ZapLogger
- func (z *ZapLogger) Debug(msg string, tags ...any)
- func (z *ZapLogger) Debugf(template string, args ...interface{})
- func (z *ZapLogger) Error(msg string, tags ...any)
- func (z *ZapLogger) Errorf(template string, args ...interface{})
- func (z *ZapLogger) Fatal(msg string, tags ...any)
- func (z *ZapLogger) Fatalf(template string, args ...interface{})
- func (z *ZapLogger) Info(msg string, tags ...any)
- func (z *ZapLogger) Infof(template string, args ...interface{})
- func (z *ZapLogger) Warn(msg string, tags ...any)
- func (z *ZapLogger) Warnf(template string, args ...interface{})
- func (z *ZapLogger) With(tags ...any) Logger
Constants ¶
View Source
const ( BaseDataDir = "data" LogsDir = "logs" )
Variables ¶
This section is empty.
Functions ¶
func InitLogger ¶
func InitLogger(env LogLevel, processName ProcessName) error
InitLogger initializes a logger for a specific process with production environment by default
Types ¶
type Logger ¶
type Logger interface { Debug(msg string, tags ...any) Info(msg string, tags ...any) Warn(msg string, tags ...any) Error(msg string, tags ...any) Fatal(msg string, tags ...any) Debugf(template string, args ...interface{}) Infof(template string, args ...interface{}) Warnf(template string, args ...interface{}) Errorf(template string, args ...interface{}) Fatalf(template string, args ...interface{}) With(tags ...any) Logger }
func GetLogger ¶
func GetLogger(env LogLevel, processName ProcessName) Logger
GetLogger returns the logger for a specific process
func NewZapLogger ¶
NewZapLogger creates a new logger wrapped the zap.Logger
type ProcessName ¶
type ProcessName string
ProcessName type to ensure valid process names
const ( ManagerProcess ProcessName = "manager" QuorumProcess ProcessName = "quorum" ValidatorProcess ProcessName = "validator" DatabaseProcess ProcessName = "database" KeeperProcess ProcessName = "keeper" )
Click to show internal directories.
Click to hide internal directories.