Reverse the coupling of module log and config #1606
No reviewers
Labels
No Label
dependencies
duplicate
help wanted
invalid
kind/bug
kind/feature
needs reproduction
question
security
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/vikunja#1606
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "HoffmannP/api:main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This way the config module can already use the log module with the same result (default logging to StdOut with Level INFO, same output as before) but ENV variables can already change the logging of config file related log output). It is now possible to dump as a cronjob without having to filter the default log about the used config file.
Also:
Reversing the coupling of mod log and configto Reversing the coupling of module log and configReversing the coupling of module log and configto Reverse the coupling of module log and configIs the constant "off" something that should be fixed?
I think it's sufficient to add it to the ignore list.
@ -415,15 +419,17 @@ func InitConfig() {
viper.SetConfigName("config")
err = viper.ReadInConfig()
log.ConfigLogger(LogEnabled.GetBool(), LogStandard.GetString(), LogPath.GetString(), LogLevel.GetString())
What if reading the config fails? Isn't this call redundant then?
You are right, I move it down into the if-branch
@ -41,42 +39,44 @@ const logModule = `vikunja`
// loginstance is the instance of the logger which is used under the hood to log
var logInstance = logging.MustGetLogger(logModule)
// logpath is the path in which log files will be written. This value should actually never be used
If it's never actually used, why specify it? Please add a comment.
Who and which list?
This ignore list: https://kolaente.dev/vikunja/api/src/branch/main/.golangci.yml
Thanks!