-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Thomas Labarussias <[email protected]>
- Loading branch information
Showing
64 changed files
with
550 additions
and
470 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
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
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,32 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
|
||
package utils | ||
|
||
import "fmt" | ||
|
||
const ( | ||
InfoLvl string = "info" | ||
InfoPrefix string = "[INFO] " | ||
ErrorLvl string = "error" | ||
ErrorPrefix string = "[ERROR]" | ||
DebugLvl string = "debug" | ||
DebugPrefix string = "[DEBUG]" | ||
WarningLvl string = "warning" | ||
WarningPrefix string = "[WARN] " | ||
FatalPrefix string = "[FATAL]" | ||
) | ||
|
||
func Log(level, output, msg string) { | ||
var prefix string | ||
switch level { | ||
case InfoLvl: | ||
prefix = InfoPrefix | ||
case ErrorLvl: | ||
prefix = ErrorPrefix | ||
case DebugLvl: | ||
prefix = DebugPrefix | ||
case WarningLvl: | ||
prefix = WarningPrefix | ||
} | ||
fmt.Printf("%v : %v - %v", prefix, output, msg) | ||
} |
Oops, something went wrong.