Documentation ¶
Index ¶
- Constants
- Variables
- func GetLevel() string
- func InitLogger() seelog.LoggerInterface
- func SetLevel(logLevel string)
- type Contextual
- func (c *Contextual) Debug(v ...interface{})
- func (c *Contextual) Debugf(format string, params ...interface{})
- func (c *Contextual) Error(v ...interface{}) error
- func (c *Contextual) Errorf(format string, params ...interface{}) error
- func (c *Contextual) Info(v ...interface{})
- func (c *Contextual) Infof(format string, params ...interface{})
- func (c *Contextual) SetContext(context map[string]string)
- func (c *Contextual) Warn(v ...interface{}) error
- func (c *Contextual) Warnf(format string, params ...interface{}) error
Constants ¶
const ( LOGLEVEL_ENV_VAR = "ECS_LOGLEVEL" LOGFILE_ENV_VAR = "ECS_LOGFILE" LOG_ROLLOVER_TYPE_ENV_VAR = "ECS_LOG_ROLLOVER_TYPE" LOG_OUTPUT_FORMAT_ENV_VAR = "ECS_LOG_OUTPUT_FORMAT" LOG_MAX_FILE_SIZE_ENV_VAR = "ECS_LOG_MAX_FILE_SIZE_MB" LOG_MAX_ROLL_COUNT_ENV_VAR = "ECS_LOG_MAX_ROLL_COUNT" DEFAULT_LOGLEVEL = "info" DEFAULT_ROLLOVER_TYPE = "date" DEFAULT_OUTPUT_FORMAT = "logfmt" DEFAULT_MAX_FILE_SIZE float64 = 10 DEFAULT_MAX_ROLL_COUNT int = 24 )
Variables ¶
var Config *logConfig
Functions ¶
func InitLogger ¶ added in v1.36.0
func InitLogger() seelog.LoggerInterface
Types ¶
type Contextual ¶ added in v1.36.0
type Contextual struct {
// contains filtered or unexported fields
}
Contextual is a logger that can have custom context added to it. Once SetContext is called, it will print log messages with the additional context appended. Before SetContext is called, it will print messages using the default agent logger.
func (*Contextual) Debug ¶ added in v1.36.0
func (c *Contextual) Debug(v ...interface{})
Debug formats message using the default formats for its operands and writes to log with level = Debug
func (*Contextual) Debugf ¶ added in v1.36.0
func (c *Contextual) Debugf(format string, params ...interface{})
Debugf formats message according to format specifier and writes to log with level = Debug.
func (*Contextual) Error ¶ added in v1.36.0
func (c *Contextual) Error(v ...interface{}) error
Error formats message using the default formats for its operands and writes to log with level = Error
func (*Contextual) Errorf ¶ added in v1.36.0
func (c *Contextual) Errorf(format string, params ...interface{}) error
Errorf formats message according to format specifier and writes to log with level = Error.
func (*Contextual) Info ¶ added in v1.36.0
func (c *Contextual) Info(v ...interface{})
Info formats message using the default formats for its operands and writes to log with level = Info
func (*Contextual) Infof ¶ added in v1.36.0
func (c *Contextual) Infof(format string, params ...interface{})
Infof formats message according to format specifier and writes to log with level = Info.
func (*Contextual) SetContext ¶ added in v1.36.0
func (c *Contextual) SetContext(context map[string]string)
func (*Contextual) Warn ¶ added in v1.36.0
func (c *Contextual) Warn(v ...interface{}) error
Warn formats message using the default formats for its operands and writes to log with level = Warn
func (*Contextual) Warnf ¶ added in v1.36.0
func (c *Contextual) Warnf(format string, params ...interface{}) error
Warnf formats message according to format specifier and writes to log with level = Warn.