-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.go
60 lines (53 loc) · 1.29 KB
/
config.go
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package golog
type LOG_LEVEL int
type LOG_STREAM int
const (
LOG_LEVEL_TRACE LOG_LEVEL = iota + 1
LOG_LEVEL_DEBUG
LOG_LEVEL_INFO
LOG_LEVEL_WARN
LOG_LEVEL_ERROR
LOG_LEVEL_CRITICAL
)
const (
LOG_STREAM_CONSOLE LOG_STREAM = iota + 1
LOG_STREAM_FILE
LOG_STREAM_MULTIPLE
)
type log_rotation_config struct {
rotate_file bool
file_name string
zip_archive bool
max_file_size int64
max_rotation_days int
}
type logger_config struct {
log_rotation_config log_rotation_config
log_level LOG_LEVEL
log_stream LOG_STREAM
log_format string
datetime_format string
with_emoji bool
exit_on_critical bool
}
type logger struct {
logger_config logger_config
}
type Logger interface {
Set_Log_Level(log_level LOG_LEVEL)
Set_Log_Format(log_format string)
Set_Log_Stream(log_stream LOG_STREAM)
Set_Datetime_Format(format string)
Set_File_Name(file_name string)
Set_Max_File_Size(max_size int64)
Set_Max_Days(max_days int)
Zip_Archive(zip_archive bool)
With_Emoji(with_emoji bool)
Exit_On_Critical(exit bool)
TRACE(msg string, a ...interface{})
DEBUG(msg string, a ...interface{})
INFO(msg string, a ...interface{})
WARN(msg string, a ...interface{})
ERROR(msg string, a ...interface{})
CRITICAL(msg string, a ...interface{})
}