Logging target from server code?
|
|
---|---|
I know how to setup logging targets in a Device Server from a DevProxy. I may have missed it but I have not seen if that can be done from Server code itself - so that a Device Server can control its own logging! |
|
|
---|---|
Hi BrianMc Good question. It appear to be possible, although not documented. You can use the `tango.Logging` class to access these kind of things. You can also access the logger instance using `self.get_logger()`, which gives you access to methods like `get_level` and `set_level`. Code for TestLogDS.py:
Run it (without a database):
Example of usage from ipython:
Looks like that gives us access to this underlying C++ code: https://github.com/tango-controls/cppTango/blob/99bbaa4b5ba4740e4666caf0f7ebc6775f12b799/cppapi/server/logging.cpp#L249 |
|
|
---|---|
Many thanks for the very helpful looking reply - I will follow it in more detail! |