-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will set the plugin log level to the same level that is configured for aether Signed-off-by: Spazzy <brendankamp757@gmail.com>
- Loading branch information
Showing
4 changed files
with
26 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package plugin | ||
|
||
import ( | ||
"github.com/hashicorp/go-hclog" | ||
"github.com/re-cinq/aether/pkg/config" | ||
) | ||
|
||
// getLogLevel is a helper function to get the log level from the config | ||
func getLogLevel() hclog.Level { | ||
level := config.AppConfig().LogLevel | ||
switch level { | ||
case "debug": | ||
return hclog.Debug | ||
case "info": | ||
return hclog.Info | ||
case "warn": | ||
return hclog.Warn | ||
case "error": | ||
return hclog.Error | ||
default: | ||
return hclog.Info | ||
} | ||
} |
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