Documentation ¶
Overview ¶
Logger levels
0.1.0-1
Logger package
0.1.0
Log writers
0.1.0
Index ¶
- Variables
- type Config
- type LogLevel
- type LogRec
- type Logger
- func (l *Logger) Debug(msg string, data ...map[string]interface{})
- func (l *Logger) Error(msg string, data ...map[string]interface{})
- func (l *Logger) Fatal(msg string, data ...map[string]interface{})
- func (l *Logger) Info(msg string, data ...map[string]interface{})
- func (l *Logger) Init() *errs.Err
- func (l *Logger) Notify(msg string, data ...map[string]interface{})
- func (l *Logger) Start() (err *errs.Err)
- func (l *Logger) Stop()
- func (l *Logger) Warning(msg string, data ...map[string]interface{})
- type Rec
Constants ¶
This section is empty.
Variables ¶
View Source
var ConsTpls = map[LogLevel]string{
LogFatal: "[\033[31mFATAL\033[0m] %msg% (%file%:%line% %func%)",
LogError: "[\033[31mERROR\033[0m] %msg% (%file%:%line% %func%)",
LogWarning: "[\033[33mWARNING\033[0m] %msg% (%file%:%line% %func%)",
LogNotify: "[\033[34mNOTIFY\033[0m] %msg% (%file%:%line% %func%)",
LogInfo: "[\033[32mINFO\033[0m] %msg% (%file%:%line% %func%)",
LogDebug: "[DBG] %msg% (%file%:%line% %func%)",
}
0.1.0-1
View Source
var FileTpls = map[LogLevel]string{
LogFatal: "%dt% [FATAL] %msg% (%file%:%line% %func%)",
LogError: "%dt% [ERROR] %msg% (%file%:%line% %func%): %msg%",
LogWarning: "%dt% [WARNING] %msg% (%file%:%line% %func%): %msg%",
LogNotify: "%dt% [NOTIFY] %msg% (%file%:%line% %func%): %msg%",
LogInfo: "%dt% [INFO] %msg% (%file%:%line% %func%): %msg%",
LogDebug: "%dt% [DEBUG] %msg% (%file%:%line% %func%): %msg%",
}
0.1.0-1
View Source
var LevelByName = map[string]LogLevel{ "fatal": LogFatal, "error": LogError, "warning": LogWarning, "notify": LogNotify, "info": LogInfo, "debug": LogDebug, }
0.1.3
View Source
var LevelNames = map[LogLevel]string{
LogFatal: "FATAL",
LogError: "ERROR",
LogWarning: "WARN",
LogNotify: "NOTE",
LogInfo: "INFO",
LogDebug: "DBG",
}
0.1.0-1
View Source
var LogTimeFmt = ""
== Шаблоны >>
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { DSN string //Строка подключения к хранилищу данных File string //Имя файла (с заменами) //= размеры каналов (буферов) > //При val =< 0 - канал не используется ConsBufSize int StoreBufSize int FileBufSize int //< размеры каналов (буферов) = //= Уровни логгирования > LevelCons LogLevel LevelFile LogLevel LevelStore LogLevel }
type LogRec ¶
type LogRec struct { Time time.Time Level string Msg string Data datatypes.JSONMap SrcFunc string SrcFile string }
Запись в БД
0.1.0-1
Click to show internal directories.
Click to hide internal directories.