snu-quiqcl / qiwis

QuIqcl Widget Integration Software
MIT License
5 stars 2 forks source link

Logger app with `logging` module #181

Closed kangz12345 closed 11 months ago

kangz12345 commented 1 year ago

Feature you want to implement

Change the logger app to show the logs generated by logging.

How the feature is implemented

Nice reference: Logging Cookbook

See #179 for more context.

Aijuh commented 1 year ago

cannot assign myself in assignees menu

Aijuh commented 1 year ago

Is logging library is included in logger.py by importing Baseapp from qiwis.py? Is it correct that the issue want logger.py get message from logging in qiwis.py? I am still reading reference and PyQt tutorials, so it might seem as weired question.

kangz12345 commented 1 year ago

Is logging library is included in logger.py by importing Baseapp from qiwis.py?

If you want to use the logging module in the logger module (logger.py), you should import logging again. That is, you should do the following in logger.py:

import logging

Is it correct that the issue want logger.py get message from logging in qiwis.py?

Yes. Currently the LoggerApp listens to the "log" channel for logging, but you will change that mechanism to handle the logs directly using the logging module.

I think you can try the following in order:

  1. Make a simple handler (you can just use these: useful handlers) in logger.py or any other file (you can create a new file).
  2. Check if it can catch the logs from qiwis module (qiwis.py).
  3. Referring to the reference, make the logger app to print out the log messages.

If you want to just create a new module leaving the logger.py, feel free to.