'Jupyter Lab logging only to command console or log console

I have some notebooks that rely on a framework which normally runs via the command line, and outputs a considerable amount of data to the console via the normal logging package. Ideally in jupyter (lab) I would like to configure it in such a way that the logging is directed to the console or some log file (where on my server i start the jupyter lab command, i want the logs there)

alternatively jupyter lab has the "Log Console" which is also fine to see the log messages, the only place I would like to not display the logs is in the cells of the notebook itself. Does anyone know how this can be accomplished (either via configuration of jupyter lab itself, or via some python codes in the first cell?)

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source