Documentation ¶
Index ¶
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Output(args ...interface{})
- func Outputf(format string, args ...interface{})
- func Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func PrintBuffer(buffer *bytes.Buffer, logDebug bool)
- func SetLevelDebug()
- func SetLevelInfo()
- func Trace(args ...interface{})
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- type ColorScheme
- type TextFormatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf formats according to a format specifier and logs message at level Debug to stdout.
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf logs a formatted message at level Error to stderr.
func Fatal ¶
func Fatal(args ...interface{})
Fatal logs a message at level Fatal to stderr then the process will exit with status set to 1.
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf logs a formatted message at level Fatal to stderr then the process will exit with status set to 1.
func Infof ¶
func Infof(format string, args ...interface{})
Infof logs a formatted message at level Info to stdout.
func Outputf ¶
func Outputf(format string, args ...interface{})
Outputf formats according to a format specifier and writes to standard output.
func Panic ¶
func Panic(args ...interface{})
Panic logs a message at level Panic to stderr; calls panic() after logging.
func Panicf ¶
func Panicf(format string, args ...interface{})
Panicf logs a formatted message at level Panic to stderr; calls panic() after logging.
func PrintBuffer ¶
PrintBuffer prints from buffer to either Debug or Info
Types ¶
type ColorScheme ¶
type ColorScheme struct { InfoLevelStyle string WarnLevelStyle string ErrorLevelStyle string FatalLevelStyle string PanicLevelStyle string DebugLevelStyle string PrefixStyle string TimestampStyle string }
ColorScheme allows changing of level colors
type TextFormatter ¶
type TextFormatter struct { // Set to true to bypass checking for a TTY before outputting colors. ForceColors bool // Force disabling colors. For a TTY colors are enabled by default. DisableColors bool // Force formatted layout, even for non-TTY output. ForceFormatting bool // Disable timestamp logging. useful when output is redirected to logging // system that already adds timestamps. DisableTimestamp bool // Disables the truncation of the level text to 4 characters. DisableLevelTruncation bool // Disable the conversion of the log levels to uppercase DisableUppercase bool // Enable logging the full timestamp when a TTY is attached instead of just // the time passed since beginning of execution. FullTimestamp bool // Timestamp format to use for display when a full timestamp is printed. TimestampFormat string // The fields are sorted by default for a consistent output. For applications // that log extremely frequently and don't use the JSON formatter this may not // be desired. DisableSorting bool // Wrap empty fields in quotes if true. QuoteEmptyFields bool // Can be set to the override the default quoting character " // with something else. For example: ', or `. QuoteCharacter string // Pad msg field with spaces on the right for display. // The value for this parameter will be the size of padding. // Its default value is zero, which means no padding will be applied for msg. SpacePadding int // Outputs raw message without timestamp or log level. DisableDecorations bool sync.Once // contains filtered or unexported fields }
TextFormatter is a custom logrus Formatter.
func (*TextFormatter) Format ¶
func (f *TextFormatter) Format(entry *logrus.Entry) ([]byte, error)
Format changes the appearance of output logs
func (*TextFormatter) SetColorScheme ¶
func (f *TextFormatter) SetColorScheme(colorScheme *ColorScheme)
SetColorScheme changes the color schema of log levels