mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-26 05:19:05 +01:00
Cleanup and linting
This commit is contained in:
parent
30cada8f28
commit
96ad865b53
@ -47,7 +47,6 @@ var (
|
|||||||
/* CONFIG */
|
/* CONFIG */
|
||||||
|
|
||||||
func Init(lvl string, logdate bool) {
|
func Init(lvl string, logdate bool) {
|
||||||
// fmt.Printf("pkg/log: Set LOGLEVEL -> %s\n", lvl)
|
|
||||||
switch lvl {
|
switch lvl {
|
||||||
case "crit":
|
case "crit":
|
||||||
ErrWriter = io.Discard
|
ErrWriter = io.Discard
|
||||||
@ -63,7 +62,6 @@ func Init(lvl string, logdate bool) {
|
|||||||
fallthrough
|
fallthrough
|
||||||
case "info":
|
case "info":
|
||||||
DebugWriter = io.Discard
|
DebugWriter = io.Discard
|
||||||
break
|
|
||||||
case "debug":
|
case "debug":
|
||||||
// Nothing to do...
|
// Nothing to do...
|
||||||
break
|
break
|
||||||
@ -72,7 +70,7 @@ func Init(lvl string, logdate bool) {
|
|||||||
//SetLogLevel("debug")
|
//SetLogLevel("debug")
|
||||||
}
|
}
|
||||||
|
|
||||||
if logdate == false {
|
if !logdate {
|
||||||
DebugLog = log.New(DebugWriter, DebugPrefix, 0)
|
DebugLog = log.New(DebugWriter, DebugPrefix, 0)
|
||||||
InfoLog = log.New(InfoWriter, InfoPrefix, 0)
|
InfoLog = log.New(InfoWriter, InfoPrefix, 0)
|
||||||
NoteLog = log.New(NoteWriter, NotePrefix, log.Lshortfile)
|
NoteLog = log.New(NoteWriter, NotePrefix, log.Lshortfile)
|
||||||
@ -141,9 +139,9 @@ func Fatal(v ...interface{}) {
|
|||||||
/* PRINT FORMAT*/
|
/* PRINT FORMAT*/
|
||||||
|
|
||||||
// Private helper
|
// Private helper
|
||||||
func printfStr(format string, v ...interface{}) string {
|
// func printfStr(format string, v ...interface{}) string {
|
||||||
return fmt.Sprintf(format, v...)
|
// return fmt.Sprintf(format, v...)
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Uses Infof() -> If errorpath required at some point:
|
// Uses Infof() -> If errorpath required at some point:
|
||||||
// Will need own writer with 'Output(2, out)' to correctly render path
|
// Will need own writer with 'Output(2, out)' to correctly render path
|
||||||
|
Loading…
Reference in New Issue
Block a user