Source code for ship.utils.log

"""

 Summary:
    Central logging setup for the whole library.
    At the moment this is pretty simplistic. It just contains a simple
    formatter and allows for setting a global library debug level.

 Author:  
     Duncan Runnacles

  Created:  
     01 Apr 2016

 Copyright:  
     Duncan Runnacles 2016

 TODO:

 Updates:

"""


import logging

[docs]def setup_custom_logger(name): formatter = logging.Formatter(fmt='%(asctime)s - %(levelname)s - %(module)s - %(message)s') handler = logging.StreamHandler() handler.setFormatter(formatter) logger = logging.getLogger(name) logger.addHandler(handler) return logger