File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -3434,6 +3434,9 @@ Reporters
3434
3434
3435
3435
StepReporter
3436
3436
~~~~~~~~~~~~
3437
+ .. warning ::
3438
+ The StepReporter is deprecated, use the `StepLogger `_ instead.
3439
+
3437
3440
The :any: `StepReporter ` outputs individual labgrid steps to `STDOUT `.
3438
3441
3439
3442
.. doctest ::
@@ -3471,6 +3474,32 @@ The Reporter can be stopped with a call to the stop function:
3471
3474
Stopping the ConsoleLoggingReporter if it has not been started will raise an
3472
3475
AssertionError, as will starting an already started StepReporter.
3473
3476
3477
+ Loggers
3478
+ -------
3479
+
3480
+ StepLogger
3481
+ ~~~~~~~~~~
3482
+ The :any: `StepLogger ` logs individual labgrid steps.
3483
+
3484
+ Logging can be set up via ``labgrid.logging.basicConfig() ``.
3485
+
3486
+ .. doctest ::
3487
+
3488
+ >>> import logging
3489
+ >>> from labgrid.logging import basicConfig, StepLogger
3490
+ >>> basicConfig(level = logging.INFO )
3491
+ >>> StepLogger.start()
3492
+
3493
+ The logger can be stopped with a call to the stop function:
3494
+
3495
+ .. doctest ::
3496
+
3497
+ >>> from labgrid.logging import StepLogger
3498
+ >>> StepLogger.stop()
3499
+
3500
+ Stopping the StepLogger if it has not been started will raise an
3501
+ AssertionError, as will starting an already started StepLogger.
3502
+
3474
3503
Environment Configuration
3475
3504
-------------------------
3476
3505
The environment configuration for a test environment consists of a YAML file
Original file line number Diff line number Diff line change @@ -764,7 +764,7 @@ Step Tracing
764
764
765
765
The Step infrastructure already collects timing and nesting information on
766
766
executed commands, but is currently only used in the pytest plugin or via the
767
- standalone StepReporter.
767
+ standalone StepLogger (or deprecated StepReporter) .
768
768
By writing these events to a file (or sqlite database) as a trace, we can
769
769
collect data over multiple runs for later analysis.
770
770
This would become more useful by passing recognized events (stack traces,
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ def __attrs_post_init__(self):
136
136
from warnings import warn
137
137
138
138
warn (
139
- "StepLogger should not be instantiated, use StepReporter .start()/.stop() instead." ,
139
+ "StepLogger should not be instantiated, use StepLogger .start()/.stop() instead." ,
140
140
DeprecationWarning ,
141
141
stacklevel = 2 ,
142
142
)
You can’t perform that action at this time.
0 commit comments