Commit 9a73082
Bugfix: Logger config not being respected (#563)
Summary:
Pull Request resolved: #563
We currently make two calls to initialize the logger in this order:
- when the logger package is imported with a default configuration
- when we have initialized the configuration with the config we just initialized
However, currently we have wrapped the logger initialization in a do once. This led to us always setting up a logger with default configurations and ignoring the second call with the configs we actually want.
I opted to remove the init function (which is called when the package is loaded) and instead have the call for the global logger create a new empty config logger if one does not exist yet. In this case, this means we'll always yield to a provided config, but also that tests can just request and receive a standard logger without needing to create one manually in every test.
Reviewed By: ivnik
Differential Revision: D84361195
fbshipit-source-id: 022e201d7a514895a4b94e15fa1334d8d6010aad1 parent 3e07c38 commit 9a73082
1 file changed
Lines changed: 9 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | 47 | | |
58 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
| |||
0 commit comments