python-microscope / microscope

Python library for control of microscope devices, supporting hardware triggers and distribution of devices over the network for performance and flexibility.
https://www.python-microscope.org
GNU General Public License v3.0
69 stars 41 forks source link

Proposed changes to deviceserver log message format ... still too long? #123

Closed mickp closed 4 years ago

mickp commented 4 years ago

The ('name') field is redundant now. I've replaced it with the module name, function name and line number that made the logging call.

Old messages:

2019-11-29 16:56:20,248:device-server (__main__):INFO:PID 25475: ... DeviceServer with PID 25478 restarted as PID 25482.
2019-11-29 16:56:20,250:Clarity (root):DEBUG:PID 25482: Debugging messages on.

New messages:

2019-11-29 16:57:26,835:INFO:PID 25525:deviceserver:keep_alive:345:... DeviceServer with PID 25530 restarted as PID 25535.
2019-11-29 16:57:26,837:DEBUG:PID 25535:deviceserver:run:176:Debugging messages on.
carandraug commented 4 years ago

The name field is not redundant. In the case of multiple devices, as long as they are different classes, the name tells us from which device server the log message comes from. For example, if the log message comes from the Setting class or Pyro or pyserial, then module name, function name, and line number are not enough to know from which device server it is coming (I guess you could search by the PID).

carandraug commented 4 years ago

Closing without merge then.