mirror of
https://github.com/h44z/wg-portal.git
synced 2025-09-15 07:11:15 +00:00
Mikrotik integration (#467)
Allow MikroTik routes as WireGuard backends
This commit is contained in:
@@ -12,8 +12,8 @@ import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
// SetupLogging initializes the global logger with the given level and format
|
||||
func SetupLogging(level string, pretty, json bool) {
|
||||
// GetLoggingHandler initializes a slog.Handler based on the provided logging level and format options.
|
||||
func GetLoggingHandler(level string, pretty, json bool) slog.Handler {
|
||||
var logLevel = new(slog.LevelVar)
|
||||
|
||||
switch strings.ToLower(level) {
|
||||
@@ -46,6 +46,13 @@ func SetupLogging(level string, pretty, json bool) {
|
||||
handler = slog.NewTextHandler(output, opts)
|
||||
}
|
||||
|
||||
return handler
|
||||
}
|
||||
|
||||
// SetupLogging initializes the global logger with the given level and format
|
||||
func SetupLogging(level string, pretty, json bool) {
|
||||
handler := GetLoggingHandler(level, pretty, json)
|
||||
|
||||
logger := slog.New(handler)
|
||||
|
||||
slog.SetDefault(logger)
|
||||
|
Reference in New Issue
Block a user