mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-26 17:49:15 +01:00
feat: add Fatalf logging method to Logger interface and ServiceLogger
- Introduced Fatalf method in Logger interface for logging fatal messages with formatted content. - Implemented Fatalf in ServiceLogger to log fatal messages and exit the program, enhancing error handling capabilities.
This commit is contained in:
@@ -37,6 +37,11 @@ func (l *ServiceLogger) Debugf(format string, args ...interface{}) {
|
||||
log.Debugf(l.getFormat(format), args...)
|
||||
}
|
||||
|
||||
// Fatalf logs a fatal message with formatted content and exits the program.
|
||||
func (l *ServiceLogger) Fatalf(format string, args ...interface{}) {
|
||||
log.Fatalf(l.getFormat(format), args...)
|
||||
}
|
||||
|
||||
func (l *ServiceLogger) getFormat(format string) string {
|
||||
return fmt.Sprintf("[%s] %s", l.prefix, format)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user