Skip to content

Commit

Permalink
Merge pull request #586 from flairNLP/update_logging_docs
Browse files Browse the repository at this point in the history
Add mandatory `set_name` to logging documentation
  • Loading branch information
addie9800 authored Aug 19, 2024
2 parents 12fa084 + 4f10b77 commit e55ecb6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/6_logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ from fundus.logging import set_log_level
set_log_level(logging.DEBUG)
````

## Format and handlers
## Format and Handlers

By default, all Fundus log messages are written to `stderr` with the following format `%(asctime)s - %(name)s - %(levelname)s - %(message)s`
To add another handler use the `add_handler` function.
Expand All @@ -68,6 +68,7 @@ import logging
from fundus.logging import add_handler

file_handler = logging.FileHandler(f"fundus.log", encoding="utf-8")
file_handler.set_name("your_custom_file_handler")
file_handler.setFormatter(logging.Formatter("%(asctime)s - %(levelname)s - %(message)s"))
add_handler(file_handler)
````
Expand Down

0 comments on commit e55ecb6

Please sign in to comment.