mirror of
https://github.com/swissmakers/fail2ban-ui.git
synced 2026-04-19 06:53:14 +02:00
Adding section comments for better readability
This commit is contained in:
@@ -20,18 +20,20 @@ import (
|
||||
"log"
|
||||
)
|
||||
|
||||
// DebugLog prints debug messages only if debug mode is enabled.
|
||||
// =========================================================================
|
||||
// Debug Logging
|
||||
// =========================================================================
|
||||
|
||||
// Prints debug messages if debug mode is enabled.
|
||||
func DebugLog(format string, v ...interface{}) {
|
||||
// Avoid deadlocks by not calling GetSettings() inside DebugLog.
|
||||
debugEnabled := false
|
||||
debugEnabled = currentSettings.Debug
|
||||
if !debugEnabled {
|
||||
return
|
||||
}
|
||||
// Ensure correct usage of fmt.Printf-style formatting
|
||||
if len(v) > 0 {
|
||||
log.Printf(format, v...) // Uses format directives
|
||||
log.Printf(format, v...)
|
||||
} else {
|
||||
log.Println(format) // Just prints the message
|
||||
log.Println(format)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user