Comments (7)
Using arguments instead of f-strings might still be valid, but last I checked it's not really viable to solve. Let me look again
from mkdocs.
I think this is the relevant documentation. Looking
https://docs.python.org/3/howto/logging-cookbook.html#formatting-styles
from mkdocs.
Yes so there are some super complicated solutions to make other formatting styles work, but this part is unchangeable about the log
methods:
- They accept only positional arguments.
extra
is for something else - They are hardcoded to use
%s
formatting.
So these two are pretty much the only reasonable options:
log.info("see %s", stuff)
log.info(f"see {stuff}")
I settled on one of them. Yes it has some performance disadvantages but big advantages in development.
from mkdocs.
Expected behaviour
Expected behavior for which piece of code?
& I think you're confusing something about the extra
parameter. Have you tried using it outside of mkdocs? I'm pretty sure it won't work like that either
from mkdocs.
& I think you're confusing something about the
extra
parameter. Have you tried using it outside of mkdocs? I'm pretty sure it won't work like that either
Oops, is tightly binded to the formatting scheme, right? Sorry for the noise, closing this...
from mkdocs.
extra
is for parameters that might be appropriate for every log message. The example shows user_id
- it's a good example, because for a website a user id may indeed be present in almost every log. Then the logging configuration can choose to either print the user id somehow at the beginning in every message, or not print it.
from mkdocs.
Thanks for the detailed explanation! ππΌ
from mkdocs.
Related Issues (20)
- Uncaught DOMException: Element.querySelectorAll: '> .dropdown-submenu > a' is not a valid selector HOT 5
- Substring search does not work
- Improve performance and authoring experience of `mkdocs serve` HOT 14
- Emit INFO instead of WARNING for Deprecated options HOT 5
- Break search plugin out into separate package HOT 8
- Empty mkdocs_theme.yml breaks build
- Generate nav with links to headers HOT 1
- ModuleNotFoundError: No module named 'mkdocs.tests' HOT 1
- FR: Anchor validation warning should remind the user it's case sensitive, especially if there are case-insensitive matches. HOT 3
- Anchor validation and special characters. HOT 2
- How to specify the port in MkDocs HOT 1
- AttributeError: 'EntryPoints' object has no attribute 'get' in xarray.backends HOT 1
- Should the markdown renderer treat a single line break as <br>? HOT 2
- Feature Request: Extend the `on_page_context` event with the reference to the Jinja2 Environment HOT 1
- Mkdocs no longer respecting set display text for same .md files. HOT 3
- Cannot get mkdocs to recognize the caseinsensitive plugin HOT 1
- Table display βflickersβ when refreshing the page HOT 2
- sourcing an external js library with in mkdocs HOT 6
- Please allow running MkDocs with Docker and strict mode HOT 6
- Default theme: N and P keys no longer work HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mkdocs.