@@ -409,10 +409,8 @@ DEMO:R1:Enabled_RBV Off
409409
410410FastCS has convenient logging support to provide status and metrics from the
411411application. To enable logging from the core framework call ` configure_logging ` with no
412- arguments (the default logging level is INFO). To log messages from a driver, either
413- import the singleton ` logger ` directly, or to provide more context to the message, call
414- ` bind_logger ` with a name (usually either the name of the module or the name of the
415- class).
412+ arguments (the default logging level is INFO). To log messages from a driver, import the
413+ singleton ` logger ` directly.
416414
417415Create a module-level logger to log status of the application start up. Create a class
418416logger for ` TemperatureControllerAttributeIO ` to log the commands it sends.
@@ -421,7 +419,7 @@ logger for `TemperatureControllerAttributeIO` to log the commands it sends.
421419:class: dropdown, hint
422420
423421:::{literalinclude} /snippets/static14.py
424- :emphasize-lines: 15,20-21,53-55,116,123
422+ :emphasize-lines: 13,48,110,117
425423:::
426424
427425::::
@@ -434,7 +432,7 @@ Try setting a PV and check the console for the log message it prints.
434432
435433A similar log message could be added for the update method of the IO, but this would be
436434very verbose. For this use case FastCS provides the ` Tracer ` class, which is inherited
437- by ` AttributeIO ` , among other core FastCS classes. This adds a enables logging ` TRACE `
435+ by ` AttributeIO ` , among other core FastCS classes. This enables the logging of ` TRACE `
438436level log messages that are disabled by default, but can be enabled at runtime.
439437
440438Update the ` send ` method of the IO to log a message showing the query that was sent and
@@ -446,13 +444,14 @@ visible.
446444:class: dropdown, hint
447445
448446:::{literalinclude} /snippets/static15.py
449- :emphasize-lines: 15,47-49,119
447+ :emphasize-lines: 13,49-51,120
450448:::
451449
452450::::
453451
454452Enable tracing on the ` power ` attribute by calling ` enable_tracing ` and then enable a
455- ramp so that the value updates. Check the console to see the messages. Call ` disable_tracing ` to disable the log messages for `power.
453+ ramp so that the value updates. Check the console to see the messages. Call
454+ ` disable_tracing ` to disable the log messages for ` power ` .
456455
457456```
458457In [1]: controller.power.enable_tracing()
@@ -472,7 +471,7 @@ In [1]: controller.power.enable_tracing()
472471In [2]: controller.power.disable_tracing()
473472```
474473
475- These log messages includes other trace loggers that log messages with ` power ` as the
474+ These log messages include other trace loggers that log messages with ` power ` as the
476475` topic ` , so they also appear automatically, so the log messages show changes to the
477476attribute throughout the stack: the query to the device and its response, the value the
478477attribute is set to, and the value that the PV in the EPICS CA transport is set to.
@@ -484,7 +483,7 @@ The `Tracer` can also be used as a module-level instance for use in free functio
484483``` python
485484from fastcs.tracer import Tracer
486485
487- tracer = Tracer(__name__ )
486+ tracer = Tracer()
488487
489488def handle_attribute (attr ):
490489 tracer.log_event(" Handling attribute" , topic = attr)
0 commit comments