diff --git a/main.go b/main.go index 5f45d89..961e649 100644 --- a/main.go +++ b/main.go @@ -54,7 +54,7 @@ func Init(eventFileName, errorFileName string) error { logger.eventFileName = eventFileName logger.errorFileName = errorFileName - path := filepath.Join(EvtDirName, eventFileName+timestamp) + path := filepath.Join(EvtDirName, eventFileName+timestamp+".txt") logger.eventf, err = os.Create(path) if err != nil { @@ -62,7 +62,7 @@ func Init(eventFileName, errorFileName string) error { return err } - path = filepath.Join(ErrDirName, errorFileName+timestamp) + path = filepath.Join(ErrDirName, errorFileName+timestamp+".txt") logger.errorf, err = os.Create(path) if err != nil { @@ -73,6 +73,10 @@ func Init(eventFileName, errorFileName string) error { return nil } +func Print(s string) { + fmt.Printf(time.Now().Format(time.RFC3339) + ": " + s + "\n") +} + func LogEvent(event string) { muEv.Lock() defer muEv.Unlock()