-
Notifications
You must be signed in to change notification settings - Fork 4
/
dronelogging.go
54 lines (44 loc) · 1.03 KB
/
dronelogging.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
package main
import (
"io"
// "io/ioutil"
"log"
"os"
)
var (
Trace *log.Logger
Info *log.Logger
Warning *log.Logger
Error *log.Logger
)
func Init(
traceHandle io.Writer,
infoHandle io.Writer,
warningHandle io.Writer,
errorHandle io.Writer) {
Trace = log.New(traceHandle,
"TRACE: ",
log.Ldate|log.Ltime|log.Lshortfile)
Info = log.New(infoHandle,
"INFO: ",
log.Ldate|log.Ltime|log.Lshortfile)
Warning = log.New(warningHandle,
"WARNING: ",
log.Ldate|log.Ltime|log.Lshortfile)
Error = log.New(errorHandle,
"ERROR: ",
log.Ldate|log.Ltime|log.Lshortfile)
}
func init() {
//Init(ioutil.Discard, os.Stdout, os.Stdout, os.Stderr)
Init(os.Stdout, os.Stdout, os.Stdout, os.Stderr)
//Trace.Println("I have something standard to say")
//Info.Println("Special Information")
//Warning.Println("There is something you need to know about")
//Error.Println("Something has failed")
Trace.Println("Drone Logging initialized")
}
func IsLogging(logType string) bool {
//// TODO: implement proper switch
return false
}