File tree Expand file tree Collapse file tree
Sources/Logging/Docs.docc/BestPractices Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,9 +144,12 @@ final class MyLibrary {
144144}
145145```
146146
147- `` Logger/init(label:) `` is for the application — typically at ` @main ` , paired with
148- `` LoggingSystem/bootstrap(_:) `` . Library code, including internal application modules,
149- should not construct loggers.
147+ `` Logger/init(label:) `` is for the application — typically at ` @main ` paired with ` .withLogger() ` .
148+ Library code, including internal application modules, should not construct loggers.
149+ If they do, setting up the global factory with `` LoggingSystem/bootstrap(_:) `` allows
150+ enforcing a specific factory on all the loggers constructed in the process. This
151+ does not necessary need to be the same factory as was used to create the task-local
152+ logger.
150153
151154#### Avoid: Relying on `` Logger/current `` across non-Task boundaries
152155
You can’t perform that action at this time.
0 commit comments