Skip to content

Commit

Permalink
Logging. Add file for docker logging
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiy.safronov committed Dec 28, 2023
1 parent 627d690 commit 9c2748b
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions logging/logger.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package core

import (
"fmt"
"time"
)

type LogInitInterface interface {
LogInit (filename string)

Info_Log (messageInput string)
Warning_Log (messageInput string)
Error_Log (messageInput string)
}

func Info_Log (messageInput string, a ...interface{}) {
messageInput = fmt.Sprintf(messageInput, a...)
messageInput = "[" + time.Now().Format("2006-01-02 15:04:05.000") + "][INFO] " + messageInput
fmt.Println(messageInput)
}

func Warning_Log (messageInput string, a ...interface{}) {
messageInput = fmt.Sprintf(messageInput, a...)
messageInput = "[" + time.Now().Format("2006-01-02 15:04:05.000") + "][WARNING] " + messageInput
fmt.Println(messageInput)
}

func Error_Log (messageInput string, a ...interface{}) {
messageInput = fmt.Sprintf(messageInput, a...)
messageInput = "[" + time.Now().Format("2006-01-02 15:04:05.000") + "][ERROR] " + messageInput
fmt.Println(messageInput)
}

func Event_Log (messageInput string, a ...interface{}) {
messageInput = fmt.Sprintf(messageInput, a...)
messageInput = "[" + time.Now().Format("2006-01-02 15:04:05.000") + "][EVENT] " + messageInput
fmt.Println(messageInput)
}

0 comments on commit 9c2748b

Please sign in to comment.