-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1198] Support for output-options alias
- Loading branch information
1 parent
808162d
commit 7151a3c
Showing
5 changed files
with
128 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
package keaconfig | ||
|
||
// A structure representing a single logger configuration. | ||
// Kea 2.5 introduced an alias output-options. Stork must now | ||
// support both output_options and output-options and return | ||
// combined loggers configuration. | ||
type Logger struct { | ||
Name string `json:"name"` | ||
OutputOptions []LoggerOutputOptions `json:"output_options"` | ||
Severity string `json:"severity"` | ||
DebugLevel int `json:"debuglevel"` | ||
Name string `json:"name"` | ||
OutputOptions []LoggerOutputOptions `json:"output_options"` | ||
OutputOptionsAlias []LoggerOutputOptions `json:"output-options"` | ||
Severity string `json:"severity"` | ||
DebugLevel int `json:"debuglevel"` | ||
} | ||
|
||
// A structure representing output_options for a logger. | ||
type LoggerOutputOptions struct { | ||
Output string `json:"output"` | ||
} | ||
|
||
// Returns combined OutputOptions and OutputOptionsAlias. | ||
func (logger Logger) GetAllOutputOptions() []LoggerOutputOptions { | ||
return append(logger.OutputOptions, logger.OutputOptionsAlias...) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters