-
Notifications
You must be signed in to change notification settings - Fork 1
/
model.go
47 lines (39 loc) · 1.51 KB
/
model.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
package go_logger
import "log"
// ===============================================================================
// Worker class, Worker is a log object used to log messages and Color specifies
// if colored output is to be produced
// ===============================================================================
type Worker struct {
Minion *log.Logger
isColor int
format string
timeFormat string
level LogLevel
}
// ===============================================================================
// Info class, Contains all the info on what has to logged, time is the current time, Module is the specific module
// For which we are logging, level is the state, importance and type of message logged,
// Message contains the string to be logged, format is the format of string to be passed to sprintf
// ===============================================================================
type Info struct {
Id uint64
Time string
Module string
Level LogLevel
Line int
Filename string
Message string
//format string
}
// ===============================================================================
// Logger class that is an interface to user to log messages, Module is the module for which we are testing
// worker is variable of Worker class that is used in bottom layers to log the message
// ===============================================================================
type Logger struct {
Module string
worker *Worker
}
type Colors struct {
ColorMap map[LogLevel]string
}