gitea: code.gitea.io/gitea/modules/log Index | Files

package log

import "code.gitea.io/gitea/modules/log"

Index

Package Files

colors.go colors_router.go conn.go console.go errors.go event.go file.go flags.go level.go log.go logger.go provider.go smtp.go stack.go writer.go

Constants

const (
    Ldate          = 1 << iota // the date in the local time zone: 2009/01/23
    Ltime                      // the time in the local time zone: 01:23:23
    Lmicroseconds              // microsecond resolution: 01:23:23.123123.  assumes Ltime.
    Llongfile                  // full file name and line number: /a/logger/c/d.go:23
    Lshortfile                 // final file name element and line number: d.go:23. overrides Llongfile
    Lfuncname                  // function name of the caller: runtime.Caller()
    Lshortfuncname             // last part of the function name
    LUTC                       // if Ldate or Ltime is set, use UTC rather than the local time zone
    Llevelinitial              // Initial character of the provided level in brackets eg. [I] for info
    Llevel                     // Provided level in brackets [INFO]

    // Last 20 characters of the filename
    Lmedfile = Lshortfile | Llongfile

    // LstdFlags is the initial value for the standard logger
    LstdFlags = Ldate | Ltime | Lmedfile | Lshortfuncname | Llevelinitial
)

These flags define which text to prefix to each log entry generated by the Logger. Bits are or'ed together to control what's printed. There is no control over the order they appear (the order listed here) or the format they present (as described in the comments). The prefix is followed by a colon only if more than time is stated is specified. For example, flags Ldate | Ltime produce, 2009/01/23 01:23:23 message. The standard is: 2009/01/23 01:23:23 ...a/logger/c/d.go:23:runtime.Caller() [I]: message

Variables

var (
    // DEFAULT is the name of the default logger
    DEFAULT = "default"
    // NamedLoggers map of named loggers
    NamedLoggers loggerMap
)
var CanColorStderr = true

CanColorStderr reports if we can color the Stderr

var CanColorStdout = true

CanColorStdout reports if we can color the Stdout Although we could do terminal sniffing and the like - in reality most tools on *nix are happy to display ansi colors. We will terminal sniff on Windows in console_windows.go

func Close Uses

func Close()

Close closes all the loggers

func ColorBytes Uses

func ColorBytes(attrs ...ColorAttribute) []byte

ColorBytes converts a list of ColorAttributes to a byte array

func ColorFprintf Uses

func ColorFprintf(w io.Writer, format string, args ...interface{}) (int, error)

ColorFprintf will write to the provided writer similar to ColorSprintf

func ColorSprintf Uses

func ColorSprintf(format string, args ...interface{}) string

ColorSprintf returns a colored string from a format and arguments arguments will be wrapped in ColoredValues to protect against color spoofing

func ColorString Uses

func ColorString(attrs ...ColorAttribute) string

ColorString converts a list of ColorAttributes to a color string

func Critical Uses

func Critical(format string, v ...interface{})

Critical records critical log

func CriticalWithSkip Uses

func CriticalWithSkip(skip int, format string, v ...interface{})

CriticalWithSkip records critical log from "skip" calls back from this function

func Debug Uses

func Debug(format string, v ...interface{})

Debug records debug log

func DelLogger Uses

func DelLogger(name string) error

DelLogger removes the named sublogger from the default logger

func DelNamedLogger Uses

func DelNamedLogger(name string)

DelNamedLogger closes and deletes the named logger

func Error Uses

func Error(format string, v ...interface{})

Error records error log

func ErrorWithSkip Uses

func ErrorWithSkip(skip int, format string, v ...interface{})

ErrorWithSkip records error log from "skip" calls back from this function

func Fatal Uses

func Fatal(format string, v ...interface{})

Fatal records fatal log and exit process

func FatalWithSkip Uses

func FatalWithSkip(skip int, format string, v ...interface{})

FatalWithSkip records fatal log from "skip" calls back from this function

func FlagsFromString Uses

func FlagsFromString(from string) int

FlagsFromString takes a comma separated list of flags and returns the flags for this string

func Info Uses

func Info(format string, v ...interface{})

Info records info log

func IsCritical Uses

func IsCritical() bool

IsCritical returns true if at least one logger is CRITICAL

func IsDebug Uses

func IsDebug() bool

IsDebug returns true if at least one logger is DEBUG

func IsErrDuplicateName Uses

func IsErrDuplicateName(err error) bool

IsErrDuplicateName checks if an error is a ErrDuplicateName.

func IsErrTimeout Uses

func IsErrTimeout(err error) bool

IsErrTimeout checks if an error is a ErrTimeout.

func IsErrUnknownProvider Uses

func IsErrUnknownProvider(err error) bool

IsErrUnknownProvider checks if an error is a ErrUnknownProvider.

func IsError Uses

func IsError() bool

IsError returns true if at least one logger is ERROR

func IsFatal Uses

func IsFatal() bool

IsFatal returns true if at least one logger is FATAL

func IsInfo Uses

func IsInfo() bool

IsInfo returns true if at least one logger is INFO

func IsTrace Uses

func IsTrace() bool

IsTrace returns true if at least one logger is TRACE

func IsWarn Uses

func IsWarn() bool

IsWarn returns true if at least one logger is WARN

func Levels Uses

func Levels() []string

Levels returns all the possible logging levels

func Log Uses

func Log(skip int, level Level, format string, v ...interface{})

Log a message with defined skip and at logging level A skip of 0 refers to the caller of this command

func NewNamedLogger Uses

func NewNamedLogger(name string, bufLen int64, subname, provider, config string) error

NewNamedLogger creates a new named logger for a given configuration

func Register Uses

func Register(name string, log loggerProvider)

Register registers given logger provider to providers.

func Stack Uses

func Stack(skip int) string

Stack will skip back the provided number of frames and return a stack trace with source code. Although we could just use debug.Stack(), this routine will return the source code and skip back the provided number of frames - i.e. allowing us to ignore preceding function calls. A skip of 0 returns the stack trace for the calling function, not including this call. If the problem is a lack of memory of course all this is not going to work...

func Trace Uses

func Trace(format string, v ...interface{})

Trace records trace log

func Warn Uses

func Warn(format string, v ...interface{})

Warn records warning log

type ChannelledLog Uses

type ChannelledLog struct {
    // contains filtered or unexported fields
}

ChannelledLog represents a cached channel to a LoggerProvider

func NewChannelledLog Uses

func NewChannelledLog(name, provider, config string, bufferLength int64) (*ChannelledLog, error)

NewChannelledLog a new logger instance with given logger provider and config.

func (*ChannelledLog) Close Uses

func (l *ChannelledLog) Close()

Close this ChannelledLog

func (*ChannelledLog) Flush Uses

func (l *ChannelledLog) Flush()

Flush this ChannelledLog

func (*ChannelledLog) GetLevel Uses

func (l *ChannelledLog) GetLevel() Level

GetLevel gets the level of this ChannelledLog

func (*ChannelledLog) GetName Uses

func (l *ChannelledLog) GetName() string

GetName returns the name of this ChannelledLog

func (*ChannelledLog) GetStacktraceLevel Uses

func (l *ChannelledLog) GetStacktraceLevel() Level

GetStacktraceLevel gets the level of this ChannelledLog

func (*ChannelledLog) LogEvent Uses

func (l *ChannelledLog) LogEvent(event *Event) error

LogEvent logs an event to this ChannelledLog

func (*ChannelledLog) Start Uses

func (l *ChannelledLog) Start()

Start processing the ChannelledLog

type ColorAttribute Uses

type ColorAttribute int

ColorAttribute defines a single SGR Code

const (
    Reset ColorAttribute = iota
    Bold
    Faint
    Italic
    Underline
    BlinkSlow
    BlinkRapid
    ReverseVideo
    Concealed
    CrossedOut
)

Base ColorAttributes

const (
    FgBlack ColorAttribute = iota + 30
    FgRed
    FgGreen
    FgYellow
    FgBlue
    FgMagenta
    FgCyan
    FgWhite
)

Foreground text colors

const (
    FgHiBlack ColorAttribute = iota + 90
    FgHiRed
    FgHiGreen
    FgHiYellow
    FgHiBlue
    FgHiMagenta
    FgHiCyan
    FgHiWhite
)

Foreground Hi-Intensity text colors

const (
    BgBlack ColorAttribute = iota + 40
    BgRed
    BgGreen
    BgYellow
    BgBlue
    BgMagenta
    BgCyan
    BgWhite
)

Background text colors

const (
    BgHiBlack ColorAttribute = iota + 100
    BgHiRed
    BgHiGreen
    BgHiYellow
    BgHiBlue
    BgHiMagenta
    BgHiCyan
    BgHiWhite
)

Background Hi-Intensity text colors

func ColorAttributeFromString Uses

func ColorAttributeFromString(from string) ColorAttribute

ColorAttributeFromString will return a ColorAttribute given a string

func (*ColorAttribute) String Uses

func (c *ColorAttribute) String() string

type ColorFormatted Uses

type ColorFormatted interface {
    // ColorFormat provides the colored representation of the value
    ColorFormat(s fmt.State)
}

ColorFormatted structs provide their own colored string when formatted with ColorSprintf

type ColoredValue Uses

type ColoredValue struct {
    Value *interface{}
    // contains filtered or unexported fields
}

ColoredValue will Color the provided value

func ColoredMethod Uses

func ColoredMethod(method string) *ColoredValue

ColoredMethod addes colors for HtTP methos on log

func ColoredStatus Uses

func ColoredStatus(status int, s ...string) *ColoredValue

ColoredStatus addes colors for HTTP status

func ColoredTime Uses

func ColoredTime(duration time.Duration) *ColoredValue

ColoredTime addes colors for time on log

func NewColoredIDValue Uses

func NewColoredIDValue(value interface{}) *ColoredValue

NewColoredIDValue is a helper function to create a ColoredValue from a Value The Value will be colored with FgCyan If a ColoredValue is provided it is not changed

func NewColoredValue Uses

func NewColoredValue(value interface{}, color ...ColorAttribute) *ColoredValue

NewColoredValue is a helper function to create a ColoredValue from a Value If no color is provided it defaults to Bold with standard Reset If a ColoredValue is provided it is not changed

func NewColoredValueBytes Uses

func NewColoredValueBytes(value interface{}, colorBytes *[]byte) *ColoredValue

NewColoredValueBytes creates a value from the provided value with color bytes If a ColoredValue is provided it is not changed

func NewColoredValuePointer Uses

func NewColoredValuePointer(value *interface{}, color ...ColorAttribute) *ColoredValue

NewColoredValuePointer is a helper function to create a ColoredValue from a Value Pointer If no color is provided it defaults to Bold with standard Reset If a ColoredValue is provided it is not changed

func (*ColoredValue) Format Uses

func (cv *ColoredValue) Format(s fmt.State, c rune)

Format will format the provided value and protect against ANSI color spoofing within the value If the wrapped value is ColorFormatted and the format is "%-v" then its ColorString will be used. It is presumed that this ColorString is safe.

func (*ColoredValue) SetColorBytes Uses

func (cv *ColoredValue) SetColorBytes(colorBytes []byte)

SetColorBytes will allow a user to set the colorBytes of a colored value

func (*ColoredValue) SetColorBytesPointer Uses

func (cv *ColoredValue) SetColorBytesPointer(colorBytes *[]byte)

SetColorBytesPointer will allow a user to set the colorBytes pointer of a colored value

func (*ColoredValue) SetResetBytes Uses

func (cv *ColoredValue) SetResetBytes(resetBytes []byte)

SetResetBytes will allow a user to set the resetBytes pointer of a colored value

func (*ColoredValue) SetResetBytesPointer Uses

func (cv *ColoredValue) SetResetBytesPointer(resetBytes *[]byte)

SetResetBytesPointer will allow a user to set the resetBytes pointer of a colored value

type ConnLogger Uses

type ConnLogger struct {
    WriterLogger
    ReconnectOnMsg bool   `json:"reconnectOnMsg"`
    Reconnect      bool   `json:"reconnect"`
    Net            string `json:"net"`
    Addr           string `json:"addr"`
}

ConnLogger implements LoggerProvider. it writes messages in keep-live tcp connection.

func (*ConnLogger) Flush Uses

func (log *ConnLogger) Flush()

Flush does nothing for this implementation

func (*ConnLogger) GetName Uses

func (log *ConnLogger) GetName() string

GetName returns the default name for this implementation

func (*ConnLogger) Init Uses

func (log *ConnLogger) Init(jsonconfig string) error

Init inits connection writer with json config. json config only need key "level".

type ConsoleLogger Uses

type ConsoleLogger struct {
    WriterLogger
    Stderr bool `json:"stderr"`
}

ConsoleLogger implements LoggerProvider and writes messages to terminal.

func (*ConsoleLogger) Flush Uses

func (log *ConsoleLogger) Flush()

Flush when log should be flushed

func (*ConsoleLogger) GetName Uses

func (log *ConsoleLogger) GetName() string

GetName returns the default name for this implementation

func (*ConsoleLogger) Init Uses

func (log *ConsoleLogger) Init(config string) error

Init inits connection writer with json config. json config only need key "level".

type ErrDuplicateName Uses

type ErrDuplicateName struct {
    Name string
}

ErrDuplicateName represents a Duplicate Name error

func (ErrDuplicateName) Error Uses

func (err ErrDuplicateName) Error() string

type ErrTimeout Uses

type ErrTimeout struct {
    Name     string
    Provider string
}

ErrTimeout represents a "Timeout" kind of error.

func (ErrTimeout) Error Uses

func (err ErrTimeout) Error() string

type ErrUnknownProvider Uses

type ErrUnknownProvider struct {
    Provider string
}

ErrUnknownProvider represents a "Unknown Provider" kind of error.

func (ErrUnknownProvider) Error Uses

func (err ErrUnknownProvider) Error() string

type Event Uses

type Event struct {
    // contains filtered or unexported fields
}

Event represents a logging event

type EventLogger Uses

type EventLogger interface {
    LogEvent(event *Event) error
    Close()
    Flush()
    GetLevel() Level
    GetStacktraceLevel() Level
    GetName() string
}

EventLogger represents the behaviours of a logger

type FileLogger Uses

type FileLogger struct {
    WriterLogger

    // The opened file
    Filename string `json:"filename"`

    // Rotate at size
    Maxsize int `json:"maxsize"`

    // Rotate daily
    Daily   bool  `json:"daily"`
    Maxdays int64 `json:"maxdays"`

    Rotate bool `json:"rotate"`

    Compress         bool `json:"compress"`
    CompressionLevel int  `json:"compressionLevel"`
    // contains filtered or unexported fields
}

FileLogger implements LoggerProvider. It writes messages by lines limit, file size limit, or time frequency.

func (*FileLogger) DoRotate Uses

func (log *FileLogger) DoRotate() error

DoRotate means it need to write file in new file. new file name like xx.log.2013-01-01.2

func (*FileLogger) Flush Uses

func (log *FileLogger) Flush()

Flush flush file logger. there are no buffering messages in file logger in memory. flush file means sync file from disk.

func (*FileLogger) GetName Uses

func (log *FileLogger) GetName() string

GetName returns the default name for this implementation

func (*FileLogger) Init Uses

func (log *FileLogger) Init(config string) error

Init file logger with json config. config like:

{
"filename":"log/gogs.log",
"maxsize":1<<30,
"daily":true,
"maxdays":15,
"rotate":true
}

func (*FileLogger) StartLogger Uses

func (log *FileLogger) StartLogger() error

StartLogger start file logger. create log file and set to locker-inside file writer.

type Level Uses

type Level int

Level is the level of the logger

const (
    // TRACE represents the lowest log level
    TRACE Level = iota
    // DEBUG is for debug logging
    DEBUG
    // INFO is for information
    INFO
    // WARN is for warning information
    WARN
    // ERROR is for error reporting
    ERROR
    // CRITICAL is for critical errors
    CRITICAL
    // FATAL is for fatal errors
    FATAL
    // NONE is for no logging
    NONE
)

func FromString Uses

func FromString(level string) Level

FromString takes a level string and returns a Level

func GetLevel Uses

func GetLevel() Level

GetLevel returns the minimum logger level

func GetStacktraceLevel Uses

func GetStacktraceLevel() Level

GetStacktraceLevel returns the minimum logger level

func (Level) MarshalJSON Uses

func (l Level) MarshalJSON() ([]byte, error)

MarshalJSON takes a Level and turns it into text

func (Level) String Uses

func (l Level) String() string

func (*Level) UnmarshalJSON Uses

func (l *Level) UnmarshalJSON(b []byte) error

UnmarshalJSON takes text and turns it into a Level

type Logger Uses

type Logger struct {
    *MultiChannelledLog
    // contains filtered or unexported fields
}

Logger is default logger in the Gitea application. it can contain several providers and log message into all providers.

func GetLogger Uses

func GetLogger(name string) *Logger

GetLogger returns either a named logger or the default logger

func NewLogger Uses

func NewLogger(bufLen int64, name, provider, config string) *Logger

NewLogger create a logger for the default logger

func (*Logger) Critical Uses

func (l *Logger) Critical(format string, v ...interface{})

Critical records critical log

func (*Logger) CriticalWithSkip Uses

func (l *Logger) CriticalWithSkip(skip int, format string, v ...interface{})

CriticalWithSkip records critical log from "skip" calls back from this function

func (*Logger) Debug Uses

func (l *Logger) Debug(format string, v ...interface{})

Debug records debug log

func (*Logger) DelLogger Uses

func (l *Logger) DelLogger(name string) (bool, error)

DelLogger deletes a sublogger from this logger.

func (*Logger) Error Uses

func (l *Logger) Error(format string, v ...interface{})

Error records error log

func (*Logger) ErrorWithSkip Uses

func (l *Logger) ErrorWithSkip(skip int, format string, v ...interface{})

ErrorWithSkip records error log from "skip" calls back from this function

func (*Logger) Fatal Uses

func (l *Logger) Fatal(format string, v ...interface{})

Fatal records fatal log and exit the process

func (*Logger) FatalWithSkip Uses

func (l *Logger) FatalWithSkip(skip int, format string, v ...interface{})

FatalWithSkip records fatal log from "skip" calls back from this function and exits the process

func (*Logger) Info Uses

func (l *Logger) Info(format string, v ...interface{})

Info records information log

func (*Logger) Log Uses

func (l *Logger) Log(skip int, level Level, format string, v ...interface{}) error

Log msg at the provided level with the provided caller defined by skip (0 being the function that calls this function)

func (*Logger) SendLog Uses

func (l *Logger) SendLog(level Level, caller, filename string, line int, msg string, stack string) error

SendLog sends a log event at the provided level with the information given

func (*Logger) SetLogger Uses

func (l *Logger) SetLogger(name, provider, config string) error

SetLogger sets new logger instance with given logger provider and config.

func (*Logger) Trace Uses

func (l *Logger) Trace(format string, v ...interface{})

Trace records trace log

func (*Logger) Warn Uses

func (l *Logger) Warn(format string, v ...interface{})

Warn records warning log

type LoggerAsWriter Uses

type LoggerAsWriter struct {
    // contains filtered or unexported fields
}

LoggerAsWriter is a io.Writer shim around the gitea log

func NewLoggerAsWriter Uses

func NewLoggerAsWriter(level string, ourLoggers ...*Logger) *LoggerAsWriter

NewLoggerAsWriter creates a Writer representation of the logger with setable log level

func (*LoggerAsWriter) Log Uses

func (l *LoggerAsWriter) Log(msg string)

Log takes a given string and logs it at the set log-level

func (*LoggerAsWriter) Write Uses

func (l *LoggerAsWriter) Write(p []byte) (int, error)

Write implements the io.Writer interface to allow spoofing of macaron

type LoggerProvider Uses

type LoggerProvider interface {
    Init(config string) error
    EventLogger
}

LoggerProvider represents behaviors of a logger provider.

func NewConn Uses

func NewConn() LoggerProvider

NewConn creates new ConnLogger returning as LoggerProvider.

func NewConsoleLogger Uses

func NewConsoleLogger() LoggerProvider

NewConsoleLogger create ConsoleLogger returning as LoggerProvider.

func NewFileLogger Uses

func NewFileLogger() LoggerProvider

NewFileLogger create a FileLogger returning as LoggerProvider.

func NewSMTPLogger Uses

func NewSMTPLogger() LoggerProvider

NewSMTPLogger creates smtp writer.

type MultiChannelledLog Uses

type MultiChannelledLog struct {
    // contains filtered or unexported fields
}

MultiChannelledLog represents a cached channel to a LoggerProvider

func NewMultiChannelledLog Uses

func NewMultiChannelledLog(name string, bufferLength int64) *MultiChannelledLog

NewMultiChannelledLog a new logger instance with given logger provider and config.

func (*MultiChannelledLog) AddLogger Uses

func (m *MultiChannelledLog) AddLogger(logger EventLogger) error

AddLogger adds a logger to this MultiChannelledLog

func (*MultiChannelledLog) Close Uses

func (m *MultiChannelledLog) Close()

Close this MultiChannelledLog

func (*MultiChannelledLog) DelLogger Uses

func (m *MultiChannelledLog) DelLogger(name string) bool

DelLogger removes a sub logger from this MultiChannelledLog NB: If you delete the last sublogger this logger will simply drop log events

func (*MultiChannelledLog) Flush Uses

func (m *MultiChannelledLog) Flush()

Flush this ChannelledLog

func (*MultiChannelledLog) GetEventLogger Uses

func (m *MultiChannelledLog) GetEventLogger(name string) EventLogger

GetEventLogger returns a sub logger from this MultiChannelledLog

func (*MultiChannelledLog) GetEventLoggerNames Uses

func (m *MultiChannelledLog) GetEventLoggerNames() []string

GetEventLoggerNames returns a list of names

func (*MultiChannelledLog) GetLevel Uses

func (m *MultiChannelledLog) GetLevel() Level

GetLevel gets the level of this MultiChannelledLog

func (*MultiChannelledLog) GetName Uses

func (m *MultiChannelledLog) GetName() string

GetName gets the name of this MultiChannelledLog

func (*MultiChannelledLog) GetStacktraceLevel Uses

func (m *MultiChannelledLog) GetStacktraceLevel() Level

GetStacktraceLevel gets the level of this MultiChannelledLog

func (*MultiChannelledLog) LogEvent Uses

func (m *MultiChannelledLog) LogEvent(event *Event) error

LogEvent logs an event to this MultiChannelledLog

func (*MultiChannelledLog) ResetLevel Uses

func (m *MultiChannelledLog) ResetLevel() Level

ResetLevel will reset the level of this MultiChannelledLog

func (*MultiChannelledLog) Start Uses

func (m *MultiChannelledLog) Start()

Start processing the MultiChannelledLog

type MuxWriter Uses

type MuxWriter struct {
    // contains filtered or unexported fields
}

MuxWriter an *os.File writer with locker.

func (*MuxWriter) Close Uses

func (mw *MuxWriter) Close() error

Close the internal writer

func (*MuxWriter) SetFd Uses

func (mw *MuxWriter) SetFd(fd *os.File)

SetFd sets os.File in writer.

func (*MuxWriter) Write Uses

func (mw *MuxWriter) Write(b []byte) (int, error)

Write writes to os.File.

type SMTPLogger Uses

type SMTPLogger struct {
    WriterLogger
    Username           string   `json:"Username"`
    Password           string   `json:"password"`
    Host               string   `json:"host"`
    Subject            string   `json:"subject"`
    RecipientAddresses []string `json:"sendTos"`
    // contains filtered or unexported fields
}

SMTPLogger implements LoggerProvider and is used to send emails via given SMTP-server.

func (*SMTPLogger) Flush Uses

func (log *SMTPLogger) Flush()

Flush when log should be flushed

func (*SMTPLogger) GetName Uses

func (log *SMTPLogger) GetName() string

GetName returns the default name for this implementation

func (*SMTPLogger) Init Uses

func (log *SMTPLogger) Init(jsonconfig string) error

Init smtp writer with json config. config like:

{
	"Username":"example@gmail.com",
	"password:"password",
	"host":"smtp.gmail.com:465",
	"subject":"email title",
	"sendTos":["email1","email2"],
	"level":LevelError
}

type WriterLogger Uses

type WriterLogger struct {
    Level           Level  `json:"level"`
    StacktraceLevel Level  `json:"stacktraceLevel"`
    Flags           int    `json:"flags"`
    Prefix          string `json:"prefix"`
    Colorize        bool   `json:"colorize"`
    Expression      string `json:"expression"`
    // contains filtered or unexported fields
}

WriterLogger represent a basic logger for Gitea

func (*WriterLogger) Close Uses

func (logger *WriterLogger) Close()

Close the base logger

func (*WriterLogger) GetLevel Uses

func (logger *WriterLogger) GetLevel() Level

GetLevel returns the logging level for this logger

func (*WriterLogger) GetName Uses

func (logger *WriterLogger) GetName() string

GetName returns empty for these provider loggers

func (*WriterLogger) GetStacktraceLevel Uses

func (logger *WriterLogger) GetStacktraceLevel() Level

GetStacktraceLevel returns the stacktrace logging level for this logger

func (*WriterLogger) LogEvent Uses

func (logger *WriterLogger) LogEvent(event *Event) error

LogEvent logs the event to the internal writer

func (*WriterLogger) Match Uses

func (logger *WriterLogger) Match(event *Event) bool

Match checks if the given event matches the logger's regexp expression

func (*WriterLogger) NewWriterLogger Uses

func (logger *WriterLogger) NewWriterLogger(out io.WriteCloser, level ...Level)

NewWriterLogger creates a new WriterLogger from the provided WriteCloser. Optionally the level can be changed at the same time.

Package log imports 19 packages (graph) and is imported by 233 packages. Updated 2019-10-01. Refresh now. Tools for package owners.