mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
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.
16 lines
463 B
Go
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) }
|