@@ -34,13 +34,8 @@ import (
3434 "aahframework.org/config.v0"
3535)
3636
37- type (
38- // FmtFlag type definition
39- fmtFlag uint8
40-
41- // Level type definition
42- level uint8
43- )
37+ // Level type definition
38+ type level uint8
4439
4540// Log Level definition
4641const (
@@ -54,53 +49,10 @@ const (
5449 LevelUnknown
5550)
5651
57- // Format flags used to define log message format for each log entry
58- const (
59- FmtFlagLevel fmtFlag = iota
60- FmtFlagTime
61- FmtFlagUTCTime
62- FmtFlagLongfile
63- FmtFlagShortfile
64- FmtFlagLine
65- FmtFlagMessage
66- FmtFlagCustom
67- FmtFlagUnknown
68- )
69-
7052var (
7153 // Version no. of aahframework.org/log library
7254 Version = "0.5"
7355
74- // FmtFlags is the list of log format flags supported by aah/log library
75- // Usage of flag order is up to format composition.
76- // level - outputs INFO, DEBUG, ERROR, so on
77- // time - outputs local time as per format supplied
78- // utctime - outputs UTC time as per format supplied
79- // longfile - outputs full file name: /a/b/c/d.go
80- // shortfile - outputs final file name element: d.go
81- // line - outputs file line number: L23
82- // message - outputs given message along supplied arguments if they present
83- // custom - outputs string as-is into log entry
84- FmtFlags = map [string ]fmtFlag {
85- "level" : FmtFlagLevel ,
86- "time" : FmtFlagTime ,
87- "utctime" : FmtFlagUTCTime ,
88- "longfile" : FmtFlagLongfile ,
89- "shortfile" : FmtFlagShortfile ,
90- "line" : FmtFlagLine ,
91- "message" : FmtFlagMessage ,
92- "custom" : FmtFlagCustom ,
93- }
94-
95- // DefaultPattern is default log entry pattern in aah/log. Only applicable to
96- // text formatter.
97- // For e.g:
98- // 2006-01-02 15:04:05.000 INFO This is my message
99- DefaultPattern = "%time:2006-01-02 15:04:05.000 %level:-5 %message"
100-
101- // BackupTimeFormat is used for timestamp with filename on rotation
102- BackupTimeFormat = "2006-01-02-15-04-05.000"
103-
10456 // ErrLogReceiverIsNil returned when suppiled receiver is nil.
10557 ErrLogReceiverIsNil = errors .New ("log: receiver is nil" )
10658
0 commit comments