Files
nomad/command/agent/log_levels.go
James Rasell 753f752cdd agent: remove unused log filter and unrequired library. (#24873)
The Nomad agent used a log filter to ensure logs were written at
the expected level. Since the use of hclog this is not required,
as hclog acts as the gate keeper and filter for logging. All log
writers accept messages from hclog which has already done the
filtering.
2025-01-17 07:51:27 +00:00

16 lines
463 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package agent
import (
"github.com/hashicorp/go-set/v3"
)
// validLogLevels is the set of log level values that are valid for a Nomad
// agent.
var validLogLevels = set.From([]string{"TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF"})
// isLogLevelValid returns whether the passed agent log level is valid.
func isLogLevelValid(level string) bool { return validLogLevels.Contains(level) }