-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Logging. Add file for docker logging
- Loading branch information
sergiy.safronov
committed
Dec 28, 2023
1 parent
627d690
commit 9c2748b
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |