2025-01-31 18:25:31 +01:00
|
|
|
// Fail2ban UI - A Swiss made, management interface for Fail2ban.
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2025 Swissmakers GmbH (https://swissmakers.ch)
|
|
|
|
|
//
|
|
|
|
|
// Licensed under the GNU General Public License, Version 3 (GPL-3.0)
|
|
|
|
|
// You may not use this file except in compliance with the License.
|
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
|
//
|
|
|
|
|
// https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
|
|
|
//
|
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
|
|
package config
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"log"
|
|
|
|
|
)
|
|
|
|
|
|
2026-02-14 19:14:27 +01:00
|
|
|
// =========================================================================
|
|
|
|
|
// Debug Logging
|
|
|
|
|
// =========================================================================
|
|
|
|
|
|
|
|
|
|
// Prints debug messages if debug mode is enabled.
|
2025-01-31 18:25:31 +01:00
|
|
|
func DebugLog(format string, v ...interface{}) {
|
|
|
|
|
debugEnabled := false
|
|
|
|
|
debugEnabled = currentSettings.Debug
|
|
|
|
|
if !debugEnabled {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if len(v) > 0 {
|
2026-02-14 19:14:27 +01:00
|
|
|
log.Printf(format, v...)
|
2025-01-31 18:25:31 +01:00
|
|
|
} else {
|
2026-02-14 19:14:27 +01:00
|
|
|
log.Println(format)
|
2025-01-31 18:25:31 +01:00
|
|
|
}
|
|
|
|
|
}
|