Documentation ¶
Index ¶
- Variables
- func Configure(config ...Config) error
- func Debug(args ...interface{})
- func Error(msg string, fields ...Field)
- func Info(msg string, fields ...Field)
- func Sync() error
- func Warn(msg string, fields ...Field)
- func With(fields ...zapcore.Field) *zap.Logger
- type Config
- type EncoderConfig
- type Field
- type Level
Constants ¶
This section is empty.
Variables ¶
var ConfigDefault = Config{ Output: os.Stdout, ErrOutput: os.Stderr, LogGrpc: true, // contains filtered or unexported fields }
ConfigDefault it is the set of default configs
Functions ¶
func Configure ¶
Configure initializes Istio's logging subsystem.
You typically call this once at process startup. Once this call returns, the logging system is ready to accept data.
func Debug ¶
func Debug(args ...interface{})
Debug outputs a message at debug level. This call is a wrapper around [Logger.Debug](https://godoc.org/go.uber.org/zap#Logger.Debug)
func Error ¶
Error outputs a message at error level. This call is a wrapper around logger.Error(https://godoc.org/go.uber.org/zap#logger.Error)
func Info ¶
Info outputs a message at information level. This call is a wrapper around logger.Info(https://godoc.org/go.uber.org/zap#logger.Info)
func Sync ¶
func Sync() error
Sync flushes any buffered log entries. Processes should normally take care to call Sync before exiting. This call is a wrapper around logger.Sync(https://godoc.org/go.uber.org/zap#logger.Sync)
func Warn ¶
Warn outputs a message at warn level. This call is a wrapper around logger.Warn(https://godoc.org/go.uber.org/zap#logger.Warn)
func With ¶
With creates a child logger and adds structured context to it. Fields added to the child don't affect the parent, and vice versa. This call is a wrapper around logger.With(https://godoc.org/go.uber.org/zap#logger.With)
Types ¶
type Config ¶ added in v0.0.2
type Config struct { // JSONEncoding controls whether the log is formatted as JSON. JSONEncoding bool // IncludeCallerSourceLocation determines whether log messages include the source location of the caller. IncludeCallerSourceLocation bool // LogGrpc indicates that Grpc logs should be captured. The default is true. // This is not exposed through the command-line flags, as this flag is mainly useful for testing: Grpc // stack will hold on to the logger even though it gets closed. This causes data races. LogGrpc bool // Output is a writer where logs are written // // Default: os.Stdout Output io.Writer // ErrOutput is a writer where logs are written // // Default: os.Stderr ErrOutput io.Writer // IsEncoding enables encoding in logging // // Default: false IsEncoding bool // EncoderConfig has encoder config which helps in encoding EncoderConfig EncoderConfig // contains filtered or unexported fields }
Config defines the set of cfg supported by Istio's component logging package.
func (*Config) GetOutputLevel ¶ added in v0.0.2
GetOutputLevel returns the minimum log output level.
func (*Config) GetStackTraceLevel ¶ added in v0.0.2
GetStackTraceLevel returns the current stack trace level.
func (*Config) SetOutputLevel ¶ added in v0.0.2
SetOutputLevel sets the minimum log output level.
func (*Config) SetStackTraceLevel ¶ added in v0.0.2
SetStackTraceLevel sets the minimum stack trace capture level.
type EncoderConfig ¶
type Level ¶
type Level string
Level is an enumeration of all supported log levels.
const ( // DebugLevel enables debug level logging DebugLevel Level = "debug" // InfoLevel enables info level logging InfoLevel Level = "info" // WarnLevel enables warn level logging WarnLevel Level = "warn" // ErrorLevel enables error level logging ErrorLevel Level = "error" // NoneLevel disables logging NoneLevel Level = "none" )