-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ASYN_TRACE_USER1, ASYN_TRACE_USER2 #63
Add ASYN_TRACE_USER1, ASYN_TRACE_USER2 #63
Conversation
I don't like ASYN_TRACE_USER1 and ASYN_TRACE_USER2, or the previous suggestion of ASYN_TRACE_INFO because they don't really describe what that debugging is enabling. I do see that there is a need for something that is not covered by the existing mask bits. How about ASYN_TRACE_STATE? This would be added to the documentation as follows:
It seems like this would cover the use cases you have described? |
The name INFO comes from the original Unix syslog API which has a number of standard log levels, which the Linux documentation describes as being:
The ASYN_TRACEIO_* bits are really something different to the loglevel. I'm not saying that we should adopt those levels, but they are a standard that has been re-used in many other logging subsystems since. It appears to me that ASYN_TRACE_FLOW is more like KERN_INFO, so I wonder if the new level should be ASYN_TRACE_NOTICE? If you do add that and want to try to adapt the naming standard maybe ASYN_TRACE_INFO could be added as a synonym for ASYN_TRACE_FLOW, with the correspondence documented? |
Similar level names (different values) in Python's logging package:
|
ad297c7
to
d730122
Compare
Sometimes it is useful to have a trace level between WARNING and FLOW to debug drivers and hardware. In case of a motor, for example, it will show when the motor starts or stops, without all the poll() messages. For a temperatur controller it may be new set points send to the device, or information when the heater is turned on or off.
d730122
to
ffb84ab
Compare
Replaced by #67, which uses the appropriate branch name |
The underlying problem is of conceptual nature. Merging these partially orthogonal concepts into a single enumeration or a flat mask does not really work. Severity is probably a number (ordered enumeration), the other two are probably enumerations or bitmasks. Implementations would often put the severity in the MSBs to allow severity filtering by simple numerical comparison. |
@ralphlange: Thanks for the clarification. |
Sometimes it is useful to have a trace level between WARNING and FLOW
to debug drivers and hardware.
In case of a motor, for example, it will show when the motor starts or
stops, without all the poll() messages.
For a temperatur controller it may be new set points send to the device,
or information when the heater is turned on or off.
Note that these trace bits are highly user and application dependent.
Without the need to change asyn may developers the ASYN_TRACE_USER1
and/or ASYN_TRACE_USER2 to whatever they need.
These bits should be integrated into the different op/ files to be
more useful (but I don't have any of them)