Skip to content

Commit

Permalink
chore(logging): correctly setup module level logger config
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjayankur31 committed Oct 15, 2024
1 parent ae7d8f0 commit 2e7bbb9
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions pyneuroml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2e7bbb9

Please sign in to comment.