Documentation ¶
Index ¶
- Variables
- type Backend
- func (self *Backend) SetFormat(format string) *Backend
- func (self *Backend) SetLevel(level l.Level) *Backend
- func (self *Backend) SetMode(mode Mode) *Backend
- func (self *Backend) SetModeNormal() *Backend
- func (self *Backend) SetSelectLevels(levels ...l.Level) *Backend
- func (self *Backend) Stop() (err error)
- type BackendName
- type Backends
- type FnReader
- type Mode
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MapTypeName = map[Type]BackendName{ BACKEND_CONSOLE: NAME_CONSOLE, BACKEND_SYSLOG: NAME_SYSLOG, BACKEND_FILE: NAME_FILE, BACKEND_GRAYLOG2: NAME_GRAYLOG2, BACKEND_MEMORYPIPE: NAME_MEMORYPIPE, BACKEND_TELEGRAM: NAME_TELEGRAM, } DefaultFormat string = `` // Set from package log function init() LogError func(args ...interface{}) // Функция log для отправки ERROR сообщений )
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
func NewBackendConsole ¶
func NewBackendFile ¶
func NewBackendGraylog2 ¶
func NewBackendGraylog2(gelf *g.GelfClient) (ret *Backend)
func NewBackendMemorypipe ¶
func NewBackendMemorypipe() (ret *Backend)
func NewBackendSyslog ¶
func NewBackendTelegram ¶
func NewBackendTelegram() (ret *Backend)
func (*Backend) SetMode ¶
Set mode filtering messages on the level of logging
MODE_NORMAL - Публикуются сообщения начиная от выбранного уровня и ниже. Напримр выбран NOTICE, публковаться будут FATAL, ALERT, CRITICAL, ERROR, WARNING, NOTICE, игнорироваться INFO, DEBUG MODE_SELECT - Публикуются сообщения только выбранных уровней
func (*Backend) SetModeNormal ¶
Set mode = MODE_NORMAL
func (*Backend) SetSelectLevels ¶
Set selected logging levels for Mode = MODE_SELECT
type BackendName ¶
type BackendName string // Mode name in configuration
const ( NAME_CONSOLE BackendName = "console" NAME_SYSLOG BackendName = "syslog" NAME_FILE BackendName = "file" NAME_GRAYLOG2 BackendName = "graylog2" NAME_MEMORYPIPE BackendName = "memorypipe" NAME_TELEGRAM BackendName = "telegram" )
func CheckMode ¶
func CheckMode(m BackendName) BackendName
type Backends ¶
type Backends struct { RecordsChan chan *m.Message // Buffered channel incoming messages Pool *list.List // Pool of backends PoolIndex map[u.UUID]*list.Element // Map of IDs backends // contains filtered or unexported fields }
func NewBackends ¶
func NewBackends() (ret *Backends)
func (*Backends) AddBackend ¶
Добавление в пул нового backend
func (*Backends) DelBackend ¶
Удаление из пула backend по его ID
Click to show internal directories.
Click to hide internal directories.