Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Adicionar doc sobre logging #5

wants to merge 1 commit into from

Conversation

denisfrm
Copy link

@denisfrm denisfrm commented Oct 14, 2021

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.

from api_pedidos.config_logging import logging


LOGGER = logging.getLogger(__name__)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

``

Suggested change
LOGGER = logging.getLogger(__name__)
logger = logging.getLogger(__name__)

uppercase é utilizado para constantes de acordo com a PEP8

Copy link
Author

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

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

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blz @jeanmask , ja alterei. Mas alterei neste PR #10 por conta das permissoes fiz um fork. Vou fechar este


@app.get("/healthcheck")
async def healthcheck():
LOGGER.debug("Hello healthcheck!")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
LOGGER.debug("Hello healthcheck!")
logger.debug("Hello healthcheck!")

@denisfrm denisfrm closed this Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants