# README
logger
The modular log for log providers
Installation
go get -u github.com/palano/logger
Quick Start
// LogConfig
type LogConfig struct {
LevelKey string
TimeKey string
MessageKey string
CallerKey string
StacktracerKey string
EnableCaller bool
EnableStacktracer bool
EnableFileLog bool
FileLog string
MaxSize int
MaxBackups int
MaxAge int
}
Example for :zap: Zap
import (
"github.com/palano/logger"
"github.com/palano/logger/zap"
)
func main() {
lc := logger.LogConfig{}
log := zap.New(lc)
log.Info("Example")
log.WithFields(logger.Fields{
"content": "example",
}).Info("Example")
}
Example for Logrus
import (
"github.com/palano/logger"
"github.com/palano/logger/logrus"
)
func main() {
lc := logger.LogConfig{}
log := logrus.New(lc)
log.Info("Example")
log.WithFields(logger.Fields{
"content": "example",
}).Info("Example")
}
Example for Zerolog
import (
"github.com/palano/logger"
"github.com/palano/logger/zerolog"
)
func main() {
lc := logger.LogConfig{}
log := zerolog.New(lc)
log.Info("Example")
log.WithFields(logger.Fields{
"content": "example",
}).Info("Example")
}
Providers
File Log Writer
- os.Stderr
- lumberjack
License
Released under the MIT License.
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
# Interfaces
No description provided by the author
# Type aliases
No description provided by the author