-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
220 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
PYTHON_MODULE_PATH=fanan | ||
|
||
clean: | ||
find . -name "*.pyc" -type f -delete | ||
find . -name "__pycache__" -type d -delete | ||
find . -name ".ipynb_checkpoints" -type d -delete | ||
|
||
format: | ||
ruff check ${PYTHON_MODULE_PATH} | ||
docformatter --in-place --recursive ${PYTHON_MODULE_PATH} | ||
|
||
pylinting: | ||
## https://vald-phoenix.github.io/pylint-errors/ | ||
pylint --output-format=colorized ${PYTHON_MODULE_PATH} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
import logging | ||
import os | ||
from datetime import datetime | ||
# import logging | ||
# import os | ||
# from datetime import datetime | ||
|
||
from rich.logging import RichHandler | ||
# from rich.logging import RichHandler | ||
|
||
|
||
def setup_logger(output_dir="logs"): | ||
# Create the output directory if it doesn't exist | ||
os.makedirs(output_dir, exist_ok=True) | ||
# def setup_logger(output_dir="logs"): | ||
# # Create the output directory if it doesn't exist | ||
# os.makedirs(output_dir, exist_ok=True) | ||
|
||
# Create a logger | ||
logger = logging.getLogger(__name__) | ||
# # Create a logger | ||
# logger = logging.getLogger(__name__) | ||
|
||
# Configure the RichHandler with the desired formatting | ||
rich_handler = RichHandler( | ||
rich_tracebacks=True, | ||
markup=True, | ||
show_time=True, | ||
omit_repeated_times=False, | ||
show_level=True, | ||
show_path=True, | ||
tracebacks_show_locals=True, | ||
) | ||
# # Configure the RichHandler with the desired formatting | ||
# rich_handler = RichHandler( | ||
# rich_tracebacks=True, | ||
# markup=True, | ||
# show_time=True, | ||
# omit_repeated_times=False, | ||
# show_level=True, | ||
# show_path=True, | ||
# tracebacks_show_locals=True, | ||
# ) | ||
|
||
# Add the RichHandler to the logger | ||
logger.addHandler(rich_handler) | ||
# # Add the RichHandler to the logger | ||
# logger.addHandler(rich_handler) | ||
|
||
# Get the current date and time | ||
current_datetime = datetime.now().strftime("%Y%m%d_%H%M%S") | ||
# # Get the current date and time | ||
# current_datetime = datetime.now().strftime("%Y%m%d_%H%M%S") | ||
|
||
# Create a FileHandler with the specified output directory and set the formatter | ||
file_handler = logging.FileHandler(os.path.join(output_dir, f"output_{current_datetime}.log")) | ||
# # Create a FileHandler with the specified output directory and set the formatter | ||
# file_handler = logging.FileHandler(os.path.join(output_dir, f"output_{current_datetime}.log")) | ||
|
||
# Add the FileHandler to the logger | ||
logger.addHandler(file_handler) | ||
# # Add the FileHandler to the logger | ||
# logger.addHandler(file_handler) | ||
|
||
# Set the logging level | ||
logger.setLevel(logging.INFO) | ||
# # Set the logging level | ||
# logger.setLevel(logging.INFO) | ||
|
||
return logger | ||
# return logger |
Oops, something went wrong.