You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the logger is initialized in `pipeline_step.py`:
9
+
The logger for DataFlow is initialized in [dataflow/logger.py](https://github.com/OpenDCAI/DataFlow/blob/main/dataflow/logger.py). Developers can directly use the `get_logger()` function defined there to obtain a logger.
Usage is as follows. `debug`, `info`, `warning`, and `error` represent different log levels. By default, logs at the DEBUG level are not shown.
16
+
Usage is as follows. The debug, info, success, warning, and error methods correspond to different logging levels. By default, logs at the DEBUG level will not be displayed.
17
+
If you want to specify a filtering rule (for example, to display DEBUG and above logging information), set the DF_LOGGING_LEVEL environment variable in the command line:
20
18
19
+
```bash
20
+
export DF_LOGGING_LEVEL=DEBUG
21
+
```
22
+
23
+
Here is an example:
21
24
```python
22
25
defmain():
23
-
24
-
logging.debug("This is DEBUG message")
25
-
logging.info("This is INFO message")
26
-
logging.warning("This is WARNING message")
27
-
logging.error("This is ERROR message")
28
-
26
+
27
+
logger.debug("This is DEBUG message")
28
+
logger.info("This is INFO message")
29
+
logger.success("This is SUCCESS message")
30
+
logger.warning("This is WARNING message")
31
+
logger.error("This is ERROR message")
32
+
29
33
return
30
34
31
35
main()
@@ -50,7 +54,7 @@ Principles for assigning log levels:
50
54
raise e
51
55
```
52
56
53
-
2. **INFO**: Used to let users know the current execution status, such as:
57
+
2. **INFO**: Used to inform the user about the current runtime status, for example:
54
58
55
59
```python
56
60
def pipeline_step(yaml_path, step_name):
@@ -66,8 +70,8 @@ Principles for assigning log levels:
66
70
algorithm.run()
67
71
```
68
72
69
-
3. **WARNING**: Error messages indicating potential issues (no examples for now).
70
-
71
-
4. **ERROR**: Errors that occur during execution; used to print error messages.
73
+
3. **SUCCESS**: Information indicating that an important step has been completed.
74
+
4. **WARNING**: Messages indicating potential problems (currently no example).
75
+
5. **ERROR**: Printed when an error occurs during execution.
72
76
73
-
For logging inside operators, refer to `DataFlow/dataflow/operators/generate/Reasoning/question_generator.py`.
77
+
For logging inside operators, you can refer to [dataflow/operators/generate/Reasoning/question_generator.py](https://github.com/OpenDCAI/DataFlow/blob/main/dataflow/operators/generate/Reasoning/question_generator.py).
0 commit comments