Skip to content Skip to sidebar Skip to footer

Integrate Nullhandler Of Library Into My Own Projects Logger

I'm developing a library of my own and an app that uses that library. I'd like to use logging in both projects. After reading this I know that my root logger in the library should

Solution 1:

Add a NullHandler to the top level logger of your library, and in your application, you'll just need to add handlers to the root logger (assuming that neither library has turned the propagate flag off from their loggers). Any calls made to log to either library should then be passed to the handlers in the root logger.

This diagram illustrates how data flows through the logging system. The root logger is an ancestor to all loggers in the system.

Post a Comment for "Integrate Nullhandler Of Library Into My Own Projects Logger"