liuxiaolong
2020-09-16 4501e38ca66f09b35aaaf43fa5a316554930fcf4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package gsyslog
 
// Priority maps to the syslog priority levels
type Priority int
 
const (
    LOG_EMERG Priority = iota
    LOG_ALERT
    LOG_CRIT
    LOG_ERR
    LOG_WARNING
    LOG_NOTICE
    LOG_INFO
    LOG_DEBUG
)
 
// Syslogger interface is used to write log messages to syslog
type Syslogger interface {
    // WriteLevel is used to write a message at a given level
    WriteLevel(Priority, []byte) error
 
    // Write is used to write a message at the default level
    Write([]byte) (int, error)
 
    // Close is used to close the connection to the logger
    Close() error
}