Documentation ¶
Index ¶
- Variables
- type Color
- type Configs
- type CustomColors
- type Logger
- func (l *Logger) Debug(message ...interface{})
- func (l *Logger) DisableColors() *Logger
- func (l *Logger) DisableJSONPrettyPrint() *Logger
- func (l *Logger) DisableObscureSensitiveData() *Logger
- func (l *Logger) DisableSinglePointTracing() *Logger
- func (l *Logger) DisableTraceCaller() *Logger
- func (l *Logger) EnableColors() *Logger
- func (l *Logger) EnableJSONPrettyPrint() *Logger
- func (l *Logger) EnableObscureSensitiveData(params []string) *Logger
- func (l *Logger) EnableSinglePointTracing() *Logger
- func (l *Logger) EnableTraceCaller() *Logger
- func (l *Logger) Error(message ...interface{})
- func (l *Logger) Fatal(message ...interface{})
- func (l *Logger) Info(message ...interface{})
- func (l *Logger) Level(level string) *Logger
- func (l *Logger) LogWriter(w io.Writer) *Logger
- func (l *Logger) Panic(message ...interface{})
- func (l *Logger) SetConfigs(configs Configs) *Logger
- func (l *Logger) SetCustomColors(colors CustomColors) *Logger
- func (l *Logger) SetDebugColor(color Color)
- func (l *Logger) SetErrorColor(color Color)
- func (l *Logger) SetInfoColor(color Color)
- func (l *Logger) SetSensitiveParams(params []string) *Logger
- func (l *Logger) SetTraceColor(color Color)
- func (l *Logger) SetWarnColor(color Color)
- func (l *Logger) Trace(message ...interface{})
- func (l *Logger) Warn(message ...interface{})
Constants ¶
This section is empty.
Variables ¶
var Blue = pointerOfString(blueColor)
Blue pointer for the CustomColors struct
var Cyan = pointerOfString(cyanColor)
Cyan pointer for the CustomColors struct
var Default = pointerOfString(defaultColor)
Default pointer for the CustomColors struct
var Disable = pointerOfBool(false)
Disable pointer for the Config struct
var Enable = pointerOfBool(true)
Enable pointer for the Config struct
var Green = pointerOfString(greenColor)
Green pointer for the CustomColors struct
var LevelDebug = pointerOfString(debugLabel)
LevelDebug pointer for the Config struct
var LevelError = pointerOfString(errorLabel)
LevelError pointer for the Config struct
var LevelInfo = pointerOfString(infoLabel)
LevelInfo pointer for the Config struct
var LevelTrace = pointerOfString(traceLabel)
LevelTrace pointer for the Config struct
var LevelWarn = pointerOfString(warnLabel)
LevelWarn pointer for the Config struct
var Purple = pointerOfString(purpleColor)
Purple pointer for the CustomColors struct
var Red = pointerOfString(redColor)
Red pointer for the CustomColors struct
var Yellow = pointerOfString(yellowColor)
Yellow pointer for the CustomColors struct
Functions ¶
This section is empty.
Types ¶
type Color ¶
type Color struct {
Code *string
}
func Background ¶
Background set the background using a string as identifiers
func NewColorRGB ¶
NewColorRGB set the color of the text using RGB Notations
func (Color) Background ¶
From a given Color it set the background using a string as identifier
type Configs ¶
type Configs struct { LogLevel *string LogWriter io.Writer JSONPrettyPrint *bool TraceCaller *bool SinglePointTracing *bool Colors *bool CustomColors *CustomColors ObscureSensitiveData *bool SensitiveParams []string }
Configs struct contains all possible configs for noodlog
type CustomColors ¶
type CustomColors struct { Trace interface{} Debug interface{} Info interface{} Warn interface{} Error interface{} }
CustomColors struct is used to specify the custom colors for the various log levels
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger represent the logger object
func (*Logger) Debug ¶
func (l *Logger) Debug(message ...interface{})
Debug function prints a log with debug log level
func (*Logger) DisableColors ¶
DisableColors function let you disable colored logs for a specified logger
func (*Logger) DisableJSONPrettyPrint ¶
DisableJSONPrettyPrint func let you disable JSON pretty printing for the specified logger instance
func (*Logger) DisableObscureSensitiveData ¶
DisableObscureSensitiveData disables sensitive data obscuration from json logs for a given logger instance
func (*Logger) DisableSinglePointTracing ¶
DisableSinglePointTracing function trace function and filename of the directl caller
func (*Logger) DisableTraceCaller ¶
DisableTraceCaller disables the tracing of the caller for the specified logger instance
func (*Logger) EnableColors ¶
EnableColors function let you enable colored logs for a specified logger
func (*Logger) EnableJSONPrettyPrint ¶
EnableJSONPrettyPrint func let you enable JSON pretty printing for the specified logger instance
func (*Logger) EnableObscureSensitiveData ¶
EnableObscureSensitiveData enables sensitive data obscuration from json logs for a given logger instance
func (*Logger) EnableSinglePointTracing ¶
EnableSinglePointTracing function enables tracing the caller when setting the logger in a single package for the whole project and recalling the logging for the project from that single point for the specified logger instance
func (*Logger) EnableTraceCaller ¶
EnableTraceCaller enables the tracing of the caller for the specified logger instance
func (*Logger) Error ¶
func (l *Logger) Error(message ...interface{})
Error function prints a log with error log level
func (*Logger) Fatal ¶
func (l *Logger) Fatal(message ...interface{})
Fatal function prints a log with fatal log level
func (*Logger) Info ¶
func (l *Logger) Info(message ...interface{})
Info function prints a log with info log level
func (*Logger) LogWriter ¶
LogWriter function let you define a logWriter (os.Stdout, a file, a buffer etc.)
func (*Logger) Panic ¶
func (l *Logger) Panic(message ...interface{})
Panic function prints a log with panic log level
func (*Logger) SetConfigs ¶
SetConfigs function allows you to rewrite all the configs at once
func (*Logger) SetCustomColors ¶
func (l *Logger) SetCustomColors(colors CustomColors) *Logger
SetCustomColors overrides defaultColor when custom color is passed into CustomColor configs
func (*Logger) SetDebugColor ¶
SetDebugColor overrides the debug level log color with the one specified in input
func (*Logger) SetErrorColor ¶
SetErrorColor overrides the error level log color with the one specified in input
func (*Logger) SetInfoColor ¶
SetInfoColor overrides the info level log color with the one specified in input
func (*Logger) SetSensitiveParams ¶
SetSensitiveParams sets sensitive data obscuration from json logs
func (*Logger) SetTraceColor ¶
SetTraceColor overrides the trace level log color with the one specified in input
func (*Logger) SetWarnColor ¶
SetWarnColor overrides the warn level log color with the one specified in input