log4go: github.com/skoo87/log4go Index | Files

package log4go

import "github.com/skoo87/log4go"

Index

Package Files

config.go console_writer.go file_writer.go log.go syslog_writer.go

Constants

const (
    DEBUG = iota
    INFO
    WARNING
    ERROR
    FATAL
)

Variables

var (
    LEVEL_FLAGS = [...]string{"DEBUG", " INFO", " WARN", "ERROR", "FATAL"}
)

func Close Uses

func Close()

func Debug Uses

func Debug(fmt string, args ...interface{})

func Error Uses

func Error(fmt string, args ...interface{})

func Fatal Uses

func Fatal(fmt string, args ...interface{})

func Info Uses

func Info(fmt string, args ...interface{})

func Register Uses

func Register(w Writer)

func SetLayout Uses

func SetLayout(layout string)

func SetLevel Uses

func SetLevel(lvl int)

func SetupLogWithConf Uses

func SetupLogWithConf(file string) (err error)

func Warn Uses

func Warn(fmt string, args ...interface{})

type ConfConsoleWriter Uses

type ConfConsoleWriter struct {
    On    bool `json:"On"`
    Color bool `json:"Color"`
}

type ConfFileWriter Uses

type ConfFileWriter struct {
    LogPath string `json:"LogPath"`
    On      bool   `json:"On"`
}

type ConsoleWriter Uses

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

func NewConsoleWriter Uses

func NewConsoleWriter() *ConsoleWriter

func (*ConsoleWriter) Init Uses

func (w *ConsoleWriter) Init() error

func (*ConsoleWriter) SetColor Uses

func (w *ConsoleWriter) SetColor(c bool)

func (*ConsoleWriter) Write Uses

func (w *ConsoleWriter) Write(r *Record) error

type FileWriter Uses

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

func NewFileWriter Uses

func NewFileWriter() *FileWriter

func (*FileWriter) Flush Uses

func (w *FileWriter) Flush() error

func (*FileWriter) Init Uses

func (w *FileWriter) Init() error

func (*FileWriter) Rotate Uses

func (w *FileWriter) Rotate() error

func (*FileWriter) SetPathPattern Uses

func (w *FileWriter) SetPathPattern(pattern string) error

func (*FileWriter) Write Uses

func (w *FileWriter) Write(r *Record) error

type Flusher Uses

type Flusher interface {
    Flush() error
}

type LogConfig Uses

type LogConfig struct {
    Level string            `json:"LogLevel"`
    FW    ConfFileWriter    `json:"FileWriter"`
    CW    ConfConsoleWriter `json:"ConsoleWriter"`
}

type Logger Uses

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

func NewLogger Uses

func NewLogger() *Logger

func (*Logger) Close Uses

func (l *Logger) Close()

func (*Logger) Debug Uses

func (l *Logger) Debug(fmt string, args ...interface{})

func (*Logger) Error Uses

func (l *Logger) Error(fmt string, args ...interface{})

func (*Logger) Fatal Uses

func (l *Logger) Fatal(fmt string, args ...interface{})

func (*Logger) Info Uses

func (l *Logger) Info(fmt string, args ...interface{})

func (*Logger) Register Uses

func (l *Logger) Register(w Writer)

func (*Logger) SetLayout Uses

func (l *Logger) SetLayout(layout string)

func (*Logger) SetLevel Uses

func (l *Logger) SetLevel(lvl int)

func (*Logger) Warn Uses

func (l *Logger) Warn(fmt string, args ...interface{})

type Record Uses

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

func (*Record) String Uses

func (r *Record) String() string

type Rotater Uses

type Rotater interface {
    Rotate() error
    SetPathPattern(string) error
}

type ShortRecord Uses

type ShortRecord Record

func (*ShortRecord) String Uses

func (r *ShortRecord) String() string

type SyslogWriter Uses

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

func NewSyslogWriter Uses

func NewSyslogWriter() *SyslogWriter

func (*SyslogWriter) Init Uses

func (w *SyslogWriter) Init() (err error)

func (*SyslogWriter) SetAddr Uses

func (w *SyslogWriter) SetAddr(addr string)

func (*SyslogWriter) SetNetwork Uses

func (w *SyslogWriter) SetNetwork(network string)

func (*SyslogWriter) SetTag Uses

func (w *SyslogWriter) SetTag(tag string)

func (*SyslogWriter) Write Uses

func (w *SyslogWriter) Write(r *Record) (err error)

type Writer Uses

type Writer interface {
    Init() error
    Write(*Record) error
}

Package log4go imports 14 packages (graph). Updated 2017-04-25. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).