Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AllLevels = []zapcore.Level{ zapcore.DebugLevel, zapcore.InfoLevel, zapcore.WarnLevel, zapcore.ErrorLevel, zapcore.FatalLevel, zapcore.PanicLevel, }
AllLevels Supported log levels
Functions ¶
Types ¶
type CloudwatchHook ¶
type CloudwatchHook struct {
// Messages with a log level not contained in this array
// will not be dispatched. If nil, all messages will be dispatched.
AcceptedLevels []zapcore.Level
GroupName string
StreamName string
AWSConfig *aws.Config
Async bool // if async is true, send a message asynchronously.
// contains filtered or unexported fields
}
CloudwatchHook is a zap Hook for dispatching messages to the specified
func NewCloudwatchHook ¶
func NewCloudwatchHook(groupName, streamName string, isAsync bool, cfg *aws.Config, level zapcore.Level) *CloudwatchHook
NewCloudwatchHook creates a new zap hook for cloudwatch
func (*CloudwatchHook) GetHook ¶
func (ch *CloudwatchHook) GetHook() (func(zapcore.Entry) error, error)
GetHook function returns hook to zap
func (*CloudwatchHook) Levels ¶
func (ch *CloudwatchHook) Levels() []zapcore.Level
Levels sets which levels to sent to cloudwatch
Click to show internal directories.
Click to hide internal directories.