Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckFormat ¶
Проверка шаблона на корректность
func TruncateString ¶
Обрезание строки в соответствии с форматом
Types ¶
type Record ¶
type Record struct { Id u.UUID `fmt:"id"` // %{id} - ([16]byte ) Time GUID(UUID) for log message Pid int `fmt:"pid:d"` // %{pid} - (int ) Process id AppName string `fmt:"application:s"` // %{application} - (string ) Application name basename of os.Args[0] HostName string `fmt:"hostname:s"` // %{hostname} - (string ) Server host name TodayAndNow time.Time `fmt:"time:t"` // %{time} - (time.Time) Time when log occurred Level l.Level `fmt:"level:d"` // %{level} - (int8 ) Log level Message string `fmt:"message:s"` // %{message} - (string ) Message FileNameLong string `fmt:"longfile:s"` // %{longfile} - (string ) Full file name and line number: /a/b/c/d.go FileNameShort string `fmt:"shortfile:s"` // %{shortfile} - (string ) Final file name element and line number: d.go FileLine int `fmt:"line:d"` // %{line} - (int ) Line number in file Package string `fmt:"package:s"` // %{package} - (string ) Full package path, eg. github.com/webdeskltd/log Module string `fmt:"module:s,shortpkg:s"` // %{module} or %{shortpkg} - (string ) Module name base package path, eg. log Function string `fmt:"function:s,facility:s"` // %{function} or %{facility} - (string ) Full function name, eg. PutUint32 CallStack string `fmt:"callstack:s"` // %{callstack} - (string ) Full call stack // contains filtered or unexported fields }
Игноритуются слеюующие поля структуры - Не имеющие тега fmt:"" - Описанные как fmt:"" - Описанные как fmt:"-" Если формат поля структуры не описан, то подставляется формат %v
func (*Record) Prepare ¶
Подготовка сообщения Выполняется подготовка сообщения перед форматированием и выводом На данном этапе из переданных ранее args формируется единое текстовое сообщение
func (*Record) Resolver ¶
func (self *Record) Resolver(f RecordResolveFn) *Record
Assigning function name resolution
Click to show internal directories.
Click to hide internal directories.