Documentation ¶
Index ¶
- type Cooler
- type Logger
- func (l *Logger) Debug(v ...interface{})
- func (l *Logger) Debugf(msg string, v ...interface{})
- func (l *Logger) Error(v ...interface{})
- func (l *Logger) Errorf(msg string, v ...interface{})
- func (l *Logger) Print(v ...interface{})
- func (l *Logger) Printf(msg string, v ...interface{})
- func (l *Logger) Rotate() (errors []error)
- func (l *Logger) SetupLogging(config *Logs)
- type Logs
- type Timer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cooler ¶
type Cooler struct {
// contains filtered or unexported fields
}
Cooler allows you to save/get if something is already running or not (active).
type Logger ¶
type Logger struct { ErrorLog *log.Logger // Shares a Writer with Logger. DebugLog *log.Logger // Shares a Writer with Logger. InfoLog *log.Logger HTTPLog *log.Logger // contains filtered or unexported fields }
Logger provides some methods with baked in assumptions.
func New ¶
func New() *Logger
New returns a new Logger with debug off and sends everything to stdout.
func (*Logger) Debug ¶
func (l *Logger) Debug(v ...interface{})
Debug writes log lines... to stdout and/or a file.
func (*Logger) Error ¶
func (l *Logger) Error(v ...interface{})
Error writes log lines... to stdout and/or a file.
func (*Logger) Print ¶
func (l *Logger) Print(v ...interface{})
Print writes log lines... to stdout and/or a file.
func (*Logger) SetupLogging ¶
SetupLogging splits log writers into a file and/or stdout.
type Logs ¶
type Logs struct { AppName string `json:"-"` LogFile string `json:"log_file" toml:"log_file" xml:"log_file" yaml:"log_file"` HTTPLog string `json:"http_log" toml:"http_log" xml:"http_log" yaml:"http_log"` LogFiles int `json:"log_files" toml:"log_files" xml:"log_files" yaml:"log_files"` LogFileMb int `json:"log_file_mb" toml:"log_file_mb" xml:"log_file_mb" yaml:"log_file_mb"` Debug bool `json:"debug" toml:"debug" xml:"debug" yaml:"debug"` Quiet bool `json:"quiet" toml:"quiet" xml:"quiet" yaml:"quiet"` }
Logs allows sending logs to rotating files. Setting an AppName will force log creation even if LogFile and HTTPLog are empty.
Click to show internal directories.
Click to hide internal directories.