Commit baa4468b76f7ffd4980a49ce0b555d277b150704

Authored by Marko Tikvić
1 parent 7fa5b8af23
Exists in master

Comments go before errors

Showing 1 changed file with 7 additions and 7 deletions   Show diff stats
... ... @@ -3,18 +3,18 @@ package gologger
3 3 import (
4 4 "fmt"
5 5 "os"
6   - "time"
7 6 "sync"
  7 + "time"
8 8 )
9 9  
10 10 var muEv = &sync.Mutex{}
11 11 var muEr = &sync.Mutex{}
12 12  
13   -const MaxLogFileSize5MB int64 = 5*1024*1024
14   -const MaxLogFileSize1MB int64 = 1*1024*1024
15   -const MaxLogFileSize500KB int64 = 500*1024
16   -const MaxLogFileSize100KB int64 = 100*1024
17   -const MaxLogFileSize512B int64 = 512
  13 +const MaxLogFileSize5MB int64 = 5 * 1024 * 1024
  14 +const MaxLogFileSize1MB int64 = 1 * 1024 * 1024
  15 +const MaxLogFileSize500KB int64 = 500 * 1024
  16 +const MaxLogFileSize100KB int64 = 100 * 1024
  17 +const MaxLogFileSize512B int64 = 512
18 18  
19 19 const ErrDirName = "error-logs"
20 20 const EvtDirName = "event-logs"
... ... @@ -139,6 +139,6 @@ func (l *Logger) LogEvent(event string) {
139 139 func (l *Logger) LogError(comment string, err error) {
140 140 muEr.Lock()
141 141 defer muEr.Unlock()
142   - l.errorf.WriteString(time.Now().Format(time.RFC3339) + ": " + err.Error() + " ::::: " + comment + "\n")
  142 + l.errorf.WriteString(time.Now().Format(time.RFC3339) + ": " + comment + ": " + err.Error() + "\n")
143 143 l.splitErrorLog()
144 144 }
... ...