Skip to content

Commit

Permalink
change logging.Formatter use __name__ attribute instead of literal st…
Browse files Browse the repository at this point in the history
…ring 'asset'
  • Loading branch information
Moritz-Alexander-Kern committed Jun 6, 2023
1 parent 09f1f43 commit 604dea3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions elephant/asset/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@
# Create logger and set configuration
logger = logging.getLogger(__file__)
log_handler = logging.StreamHandler()
log_handler.setFormatter(logging.Formatter("[%(asctime)s] asset -"
" %(levelname)s: %(message)s"))
log_handler.setFormatter(
logging.Formatter(f"[%(asctime)s] {__name__[__name__.rfind('.')+1::]} -"
" %(levelname)s: %(message)s"))
logger.addHandler(log_handler)
logger.propagate = False

Expand Down

0 comments on commit 604dea3

Please sign in to comment.