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
Adicionar doc sobre logging #5
Conversation
from api_pedidos.config_logging import logging | ||
|
||
|
||
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.
``
LOGGER = logging.getLogger(__name__) | |
logger = logging.getLogger(__name__) |
uppercase é utilizado para constantes de acordo com a PEP8
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.
Oi @jeanmask mas a idéia do logger é ser uma global
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.
Uma variavel global continua sendo uma variavel, então é minúsculo, hehe
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.
Incisive vc pode observar isso nos exemplos da lib logging da doc do python
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.
|
||
@app.get("/healthcheck") | ||
async def healthcheck(): | ||
LOGGER.debug("Hello healthcheck!") |
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.
LOGGER.debug("Hello healthcheck!") | |
logger.debug("Hello healthcheck!") |
O PR tem como objetivo adicionar uma sugestão de documentação para utilização de logging.
Detalhe: Não fiz os links de voltar e avançar, pois não sei em que parte vai se encaixar.