Skip to content

Commit

Permalink
feat: set default log level as info (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
vncsna authored Sep 26, 2023
1 parent 8caba6f commit fc3efec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion basedosdados_api/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def emit(self, record: LogRecord):


def setup_logger(
level: str = "INFO",
serialize: bool = False,
format: str = "[{time:YYYY-MM-DD HH:mm:ss}] <lvl>{message}</>",
):
Expand All @@ -40,7 +41,7 @@ def setup_logger(

logger.add(
stdout,
level="DEBUG",
level=level,
format=format,
serialize=serialize,
)
Expand Down
2 changes: 1 addition & 1 deletion basedosdados_api/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
DEFAULT_FROM_EMAIL = getenv("EMAIL_HOST_USER", "NOT SET")

# Logging
setup_logger(serialize=False)
setup_logger(level="DEBUG", serialize=False)
2 changes: 1 addition & 1 deletion basedosdados_api/settings/prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
DEFAULT_FROM_EMAIL = getenv("EMAIL_HOST_USER")

# Logging
setup_logger(serialize=True)
setup_logger(level="INFO", serialize=True)

# Google Application Credentials
GOOGLE_APPLICATION_CREDENTIALS = getenv("GOOGLE_APPLICATION_CREDENTIALS", "")
Expand Down

0 comments on commit fc3efec

Please sign in to comment.