Documentation ¶
Index ¶
- Constants
- Variables
- func CreateLogWriter(config *Config) io.Writer
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func EnsureDir(dir string) error
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func InitGlobalLogger(writer io.Writer, levelStr string) error
- func InitInMemoryWriter() io.WriteCloser
- func IsDirWritable(dir string) bool
- func NewPrefixDateTimeProxy(prefix string, writer io.Writer) io.Writer
- func NewRollingWriter(config *Config) io.WriteCloser
- func SystemError(v ...interface{})
- func SystemErrorf(format string, v ...interface{})
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type Config
- type DateTimeWriterProxy
- type Dual
- type Level
- type LoggerConfig
- type ObjectLogger
- type PrefixDateTimeProxy
- type QueryLogger
- type RollingWriterProxy
- type SQLDebugConfig
- type StringWriter
- type TaskLogger
- type WriterMock
Constants ¶
View Source
const ( DDLLogerType = "ddl-debug" QueriesLoggerType = "sql-debug" )
View Source
const (
GlobalType = "global"
)
Variables ¶
View Source
var ConfigErr string
View Source
var ConfigWarn string
View Source
var GlobalLogsWriter io.Writer
View Source
var LogLevel = UNKNOWN
View Source
var TokenIDExtractRegexp = regexp.MustCompile("incoming.tok=(.*)-\\d\\d\\d\\d-\\d\\d-\\d\\dT")
TokenIDExtractRegexp is a regex for reading already rotated and closed log files
Functions ¶
func CreateLogWriter ¶
func InitGlobalLogger ¶
InitGlobalLogger initializes main logger
func InitInMemoryWriter ¶
func InitInMemoryWriter() io.WriteCloser
func IsDirWritable ¶
func NewPrefixDateTimeProxy ¶
func NewRollingWriter ¶
func NewRollingWriter(config *Config) io.WriteCloser
func SystemError ¶
func SystemError(v ...interface{})
func SystemErrorf ¶
func SystemErrorf(format string, v ...interface{})
Types ¶
type Config ¶
type DateTimeWriterProxy ¶
type DateTimeWriterProxy struct {
// contains filtered or unexported fields
}
type LoggerConfig ¶
type LoggerConfig struct { Path string `mapstructure:"path" json:"path,omitempty" yaml:"path,omitempty"` RotationMin int64 `mapstructure:"rotation_min" json:"rotation_min,omitempty" yaml:"rotation_min,omitempty"` MaxBackups int `mapstructure:"max_backups" json:"max_backups,omitempty" yaml:"max_backups,omitempty"` }
type ObjectLogger ¶
type PrefixDateTimeProxy ¶
type PrefixDateTimeProxy struct {
// contains filtered or unexported fields
}
type QueryLogger ¶
type QueryLogger struct {
// contains filtered or unexported fields
}
func NewQueryLogger ¶
func (*QueryLogger) LogDDL ¶
func (l *QueryLogger) LogDDL(query string)
func (*QueryLogger) LogQuery ¶
func (l *QueryLogger) LogQuery(query string)
func (*QueryLogger) LogQueryWithValues ¶
func (l *QueryLogger) LogQueryWithValues(query string, values []interface{})
type RollingWriterProxy ¶
type RollingWriterProxy struct {
// contains filtered or unexported fields
}
RollingWriterProxy for lumberjack.Logger Rotate() only if file isn't empty
func (*RollingWriterProxy) Close ¶
func (rwp *RollingWriterProxy) Close() error
type SQLDebugConfig ¶
type SQLDebugConfig struct { DDL *LoggerConfig `mapstructure:"ddl" json:"ddl,omitempty" yaml:"ddl,omitempty"` Queries *LoggerConfig `mapstructure:"queries" json:"queries,omitempty" yaml:"queries,omitempty"` }
type StringWriter ¶
type StringWriter struct {
// contains filtered or unexported fields
}
func NewStringWriter ¶
func NewStringWriter() *StringWriter
func (*StringWriter) Bytes ¶
func (sw *StringWriter) Bytes() []byte
func (*StringWriter) Close ¶
func (sw *StringWriter) Close() error
func (*StringWriter) String ¶
func (sw *StringWriter) String() string
type TaskLogger ¶
type WriterMock ¶
type WriterMock struct {
Data [][]byte
}
var InstanceMock *WriterMock
func (*WriterMock) Close ¶
func (im *WriterMock) Close() (err error)
Click to show internal directories.
Click to hide internal directories.