Skip to content

Commit 35e6964

Browse files
authored
Merge pull request #21 from prompt-security/print_warnings_and_errors_to_screen
Print warnings and errors to the screen (stderr)
2 parents 96421f6 + 3f3da99 commit 35e6964

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ps_fuzz/ps_logging.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@ def setup_logging(debug_level: int):
1818

1919
# Configure the root logger to use the file handler
2020
logging.basicConfig(level=logging_level, format='%(asctime)s [%(levelname)s] [%(filename)s:%(lineno)d]: %(message)s', handlers=[file_handler])
21+
22+
# Adding a StreamHandler to output warnings and errors to stderr (default behavior)
23+
console_handler = logging.StreamHandler()
24+
console_handler.setLevel(logging.WARNING) # Set to log WARNING and higher (ERROR, CRITICAL)
25+
console_handler.setFormatter(formatter)
26+
logging.getLogger().addHandler(console_handler)

0 commit comments

Comments
 (0)