-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the mandr logger to give the user full control over logging #35
Conversation
thomass-dev
commented
Jul 10, 2024
src/mandr/app.py
Outdated
@@ -83,8 +82,8 @@ def render_top_nav(*args): | |||
for g in glob | |||
if g.is_dir() and not g.parts[-1].startswith("_") | |||
] | |||
console.log(f"{links_out=}") | |||
console.log(f"{path_pairs=}") | |||
logger.info(f"{links_out=}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would log at debug level here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/mandr/app.py
Outdated
@@ -122,7 +121,7 @@ def home(path): | |||
if len(path) == 0: | |||
return render_mander(*[]) | |||
path_parts = path.split("/") | |||
console.log(f"{path_parts=}") | |||
logger.info(f"{path_parts=}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As well, I would log at debug level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
app = Flask(__name__) | ||
logger = logging.getLogger(__name__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's quite annoying that they do not respect the usual function naming conventions. Is there a reason to use Rich specifically? I would appreciate an alternative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its not Rich here, its the standard python logging library.
Its usual for the standard libraries in cpython that function respects camel case.
There is no alternative in the logging library to do this with a snake case function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah my bad, now I see.