diff --git a/pyneuroml/__init__.py b/pyneuroml/__init__.py index ce1ec3e0..44570f54 100644 --- a/pyneuroml/__init__.py +++ b/pyneuroml/__init__.py @@ -14,12 +14,21 @@ JNEUROML_VERSION = "0.13.3" -# Define a logger for the package -logging.basicConfig( - format="pyNeuroML >>> %(levelname)s - %(message)s", - level=logging.WARN, +logger = logging.getLogger(__name__) +logger.propagate = False +logger.setLevel(logging.INFO) + +ch = logging.StreamHandler() +# do not set level + +formatter = logging.Formatter( + "pyNeuroML >>> %(asctime)s - %(levelname)s - %(message)s", datefmt="%H:%M:%S" ) +ch.setFormatter(formatter) + +logger.addHandler(ch) + def print_v(msg): """Print message to console.