Skip to content

Commit

Permalink
fix: indent typo
Browse files Browse the repository at this point in the history
  • Loading branch information
jjjermiah committed Nov 29, 2024
1 parent 2b1ddc9 commit e0cf8ab
Showing 1 changed file with 42 additions and 42 deletions.
84 changes: 42 additions & 42 deletions src/imgtools/logging/logging_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,45 +169,45 @@ def get_logger(self) -> structlog.stdlib.BoundLogger:
"""
return structlog.get_logger(self.name)

def configure_logging(
self, level: str = DEFAULT_LOG_LEVEL
) -> structlog.stdlib.BoundLogger:
"""
Dynamically adjust logging settings.
Parameters
----------
level : str, optional
Set the log level.
Returns
-------
structlog.stdlib.BoundLogger
Updated logger instance.
Raises
------
ValueError
If an invalid log level is specified.
"""
level_upper = level.upper()
if level_upper not in VALID_LOG_LEVELS:
msg = f'Invalid logging level: {level}'
raise ValueError(msg)
# Store the old level for logging the change
old_level = self.level
self.level = level_upper

self._initialize_logger()
logger = self.get_logger()
# Log the level change
if old_level != self.level:
logger.info(
"Log level changed",
old_level=old_level,
new_level=self.level
)

return logger
def configure_logging(
self, level: str = DEFAULT_LOG_LEVEL
) -> structlog.stdlib.BoundLogger:
"""
Dynamically adjust logging settings.
Parameters
----------
level : str, optional
Set the log level.
Returns
-------
structlog.stdlib.BoundLogger
Updated logger instance.
Raises
------
ValueError
If an invalid log level is specified.
"""
level_upper = level.upper()
if level_upper not in VALID_LOG_LEVELS:
msg = f'Invalid logging level: {level}'
raise ValueError(msg)
# Store the old level for logging the change
old_level = self.level
self.level = level_upper

self._initialize_logger()
logger = self.get_logger()
# Log the level change
if old_level != self.level:
logger.info(
"Log level changed",
old_level=old_level,
new_level=self.level
)

return logger

0 comments on commit e0cf8ab

Please sign in to comment.