This repository has been archived by the owner on May 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Logging config lost when using DockerAppManager #1477
Comments
I like the third approach. Of course, it doesn't solve the annoying problem with Config/Logger in general, but I think this would be a step in the right direction. Passing the whole Config object around makes it harder to understand the dependencies and more error-prone, IMO. |
doanac
added a commit
to doanac/aktualizr
that referenced
this issue
Dec 9, 2019
This is subtle so I'm keeping what's really two changes as one commit: The issue is that DockerAppManger's constructor needs to create a "fake fetcher" that's not really used but required for constructing member variables and they don't have access to the global Config. Only the PackageManagerConfig. Calling the `Config` default constructor results in a call to `postUpdateValues` that then calls `logger_set_threshold` with the default logging level, INFO. This commit updates the Fetch constructor to only use the values that it needs from the globabl config: repo-server and director-server. The DockerAppMgr constructor then doesn't to create a fake global config. Signed-off-by: Andy Doan <[email protected]>
doanac
added a commit
to doanac/aktualizr
that referenced
this issue
Dec 9, 2019
This is subtle so I'm keeping what's really two changes as one commit: The issue is that DockerAppManger's constructor needs to create a "fake fetcher" that's not really used but required for constructing member variables and they don't have access to the global Config. Only the PackageManagerConfig. Calling the `Config` default constructor results in a call to `postUpdateValues` that then calls `logger_set_threshold` with the default logging level, INFO. This commit updates the Fetch constructor to only use the values that it needs from the globabl config: repo-server and director-server. The DockerAppMgr constructor then doesn't to create a fake global config. Signed-off-by: Andy Doan <[email protected]>
lbonn
added a commit
that referenced
this issue
Dec 11, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Commit 46e4e2f seemed innocent but it has a nasty side-effect due to the way the
Config
class default constructor works. It callspostUpdateValues
which will then calllogger_set_threshold
with the default logging level of "info". So any time the DockerAppMgr is in use you are stuck at loglevel info (for all code called after the constructor).The two easiest approaches I see are:
Feel free to choose an approach and merge, or let me know and I'll do a PR.
The text was updated successfully, but these errors were encountered: