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
* Feature-298: Flag to Disable File Generation
* Feature-298: Flag to Disable File Generation
* Rename flag to suppress-logs
* Fix bug in CoverAgent
* Add files creation suppression logic
* Improve logger usage in classes
* Refactor CustomLogger
* Fix failing test test_main_test_file_not_found
* Extend tests to check if suppress-logs passed or not
* Add file logger test for CustomLogger
* Add log level handling and tests
* Remove get log_level from env var
* Rename suppress-logs to suppress-log-files
* Apply review suggestion for log suppression description
* Improve tests integration scripts
* Remove .coveragerc file due to side effects
---------
Co-authored-by: akashjainwork <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -215,6 +215,8 @@ A few debug files will be outputted locally within the repository (that are part
215
215
*`stdout`
216
216
* Generated test
217
217
218
+
You can suppress logs using the `--suppress-log-files` flag. This prevents the creation of the `run.log`, `test_results.html`, and the test results `db` files.
219
+
218
220
### Additional logging
219
221
If you set an environment variable `WANDB_API_KEY`, the prompts, responses, and additional information will be logged to [Weights and Biases](https://wandb.ai/).
f"Total number of output tokens used for LLM model {self.args.model}: {self.test_gen.total_output_token_count+self.test_validator.total_output_token_count}"
generate_log_files (bool): Whether to generate log files.
14
+
file_level (int): The log level to use.
15
+
console_level (int): The log level to use.
13
16
14
17
Returns:
15
18
logging.Logger: The logger object.
16
19
17
20
Note:
18
-
This method sets up the logger to handle all messages of DEBUG level and above. It adds a file handler to write log messages to a file specified by 'log_file_path' and a stream handler to output log messages to the console. The log file is overwritten on each run.
21
+
This method sets up the logger to handle all messages of DEBUG level and above.
22
+
It adds a file handler to write log messages to a file specified by 'log_file_path' and a stream handler
23
+
to output log messages to the console. The log file is overwritten on each run.
19
24
20
25
Example:
21
26
logger = CustomLogger.get_logger('my_logger')
@@ -26,35 +31,27 @@ def get_logger(cls, name):
26
31
logger.critical('This is a critical message')
27
32
"""
28
33
logger=logging.getLogger(name)
29
-
logger.setLevel(
30
-
logging.DEBUG
31
-
) # Set the logger to handle all messages of DEBUG level and above
34
+
logger.setLevel(logging.DEBUG)
32
35
33
36
# Specify the log file path
34
37
log_file_path="run.log"
35
38
36
39
# Check if handlers are already set up to avoid adding them multiple times
0 commit comments