Documentation ¶
Index ¶
- Constants
- type Console
- func (c *Console) AutoPrint()
- func (c *Console) Finish(printStats bool, extraMessage ...interface{})
- func (c *Console) NewLine()
- func (c *Console) Print(message string, args ...interface{})
- func (c *Console) Println(message string, args ...interface{})
- func (c *Console) SetPrintFunc(print func() string)
- func (c *Console) SetWriter(writer io.Writer)
- func (c *Console) Start(prefix string)
- func (c *Console) Tick()
- type LogLevel
- type Logger
- func (l *Logger) Close() error
- func (l *Logger) CriticalF(category, format string, a ...interface{})
- func (l *Logger) DebugF(category, format string, a ...interface{})
- func (l *Logger) ErrorF(category, format string, a ...interface{})
- func (l *Logger) FatalF(category, format string, a ...interface{})
- func (l *Logger) GetStackTraceOffset() int
- func (l *Logger) InfoF(category, format string, a ...interface{})
- func (l *Logger) NoticeF(category, format string, a ...interface{})
- func (l *Logger) PanicF(category, format string, a ...interface{})
- func (l *Logger) Print(v ...interface{})
- func (l *Logger) SetStackTraceOffset(offset int)
- func (l *Logger) Stack() string
- func (l *Logger) StackAsCritical(category, message string)
- func (l *Logger) StackAsError(category, message string)
- func (l *Logger) WarningF(category, format string, a ...interface{})
- func (l *Logger) Write(bytes []byte) (int, error)
- type LoggerConfig
- type MultipleWriter
- type UnixSocketLogger
Constants ¶
View Source
const ( Black = iota + 30 Red Green Yellow Blue Magenta Cyan White )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Console ¶ added in v0.0.6
type Console struct {
// contains filtered or unexported fields
}
func NewConsole ¶ added in v0.0.6
func (*Console) SetPrintFunc ¶ added in v0.0.8
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewLogger ¶
func NewLogger(config LoggerConfig) (*Logger, error)
func (*Logger) GetStackTraceOffset ¶ added in v0.0.2
func (*Logger) SetStackTraceOffset ¶ added in v0.0.2
func (*Logger) StackAsCritical ¶
func (*Logger) StackAsError ¶
type LoggerConfig ¶
type LoggerConfig struct { LogLevel LogLevel Format string // placeholders: %{id}, %{time[:fmt]}, %{module}, %{filename}, %{line}, %{level}, %{message}, %{category} LogToFile bool FilePath string FilePerm os.FileMode LogToStdOut bool StdOutColor int LogToUnixSocket bool UnixSocketPath string AdditionalWriters []io.Writer AdditionalWriterClosers []io.WriteCloser SetAsDefaultLogger bool }
func DefaultLoggerConfig ¶
func DefaultLoggerConfig() LoggerConfig
type MultipleWriter ¶
type MultipleWriter struct {
// contains filtered or unexported fields
}
func NewMultipleWriter ¶
func NewMultipleWriter(writers ...io.Writer) MultipleWriter
type UnixSocketLogger ¶
type UnixSocketLogger struct {
// contains filtered or unexported fields
}
func NewUnixSockerLogger ¶
func NewUnixSockerLogger(path string) *UnixSocketLogger
Click to show internal directories.
Click to hide internal directories.