Files

46 lines
1.5 KiB
Go
Raw Permalink Normal View History

2022-07-07 11:22:28 -04:00
package levellogger
import (
"log"
)
// Log Level Importance
// Fatal One or more key business functionalities are not working and the whole system doesnt fulfill the business functionalities.
// Error One or more functionalities are not working, preventing some functionalities from working correctly.
// Warn Unexpected behavior happened inside the application, but it is continuing its work and the key business features are operating as expected.
// Security A violation of the app's security practises
2022-07-07 11:22:28 -04:00
// Info An event happened, the event is purely informative and can be ignored during normal operations.
// Debug A log level used for events considered to be useful during software debugging when more granular information is needed.
// Trace A log level describing events showing step by step execution of your code that can be ignored during the standard operation, but may be useful during extended debugging sessions.
type LogLevel int
const (
LevelLoggerOff LogLevel = iota
PanicLevel
TraceLevel
DebugLevel
InfoLevel
SecurityLevel
WarnLevel
ErrorLevel
FatalLevel
2022-07-07 11:22:28 -04:00
)
// type LevelLogger interface {
// NewLevelLogger(out io.Writer, prefix string, flag int) *log.Logger
// }
type LevelLogger struct {
CurrentLevel LogLevel
panicLog *log.Logger
traceLog *log.Logger
debugLog *log.Logger
infoLog *log.Logger
securityLog *log.Logger
2022-07-07 11:22:28 -04:00
warnLog *log.Logger
errorLog *log.Logger
fatalLog *log.Logger
blankLog *log.Logger
2022-07-07 11:22:28 -04:00
}