Skip to content

Commit

Permalink
Merge pull request #247 from Becksteinlab/update-log-banner
Browse files Browse the repository at this point in the history
update banner logging
  • Loading branch information
orbeckst committed Jun 21, 2023
2 parents cafb300 + 9da48a8 commit edc63b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Changes
EnsembleAnalysis.run() method, no longer needed (per comments, #199)
* added support for Python 3.10
* dropped testing on Python 3.6
* internal log_banner() now uses logger as argument

Enhancements

Expand Down
8 changes: 5 additions & 3 deletions mdpow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ def create_logger(logfile="mdpow.log"):
log.create('gromacs', logfile) # and the GromacsWrapper messages
return logger

def log_banner():
def log_banner(logger):
"""Log program name and licence at INFO level."""
logger.info("MDPOW %s starting.", __version__)
logger.info("Copyright (c) 2010-2021 Shujie Fan, Ian Kenney, Alia Lescoulie, Bogdan Iorga, and Oliver Beckstein")
logger.info("Copyright (c) 2010-2023 Shujie Fan, Ian Kenney, "
"Alia Lescoulie, Cade Duckworth, Bogdan Iorga, and "
"Oliver Beckstein")
logger.info("Released under the GNU Public Licence, version 3.")
logger.info("For bug reports and help: https://github.com/Becksteinlab/MDPOW/issues")

logger = create_logger()
log_banner()
log_banner(logger)

# AVOID IMPORTS OF OTHER PACKAGES IN __init__.py; only standard
# library and mdpow.log are allowed. Anything else will break 'pip
Expand Down

0 comments on commit edc63b7

Please sign in to comment.