Skip to content

Commit

Permalink
Merge pull request #24 from UniversalDevicesInc/logger
Browse files Browse the repository at this point in the history
Comment out basicConfig call for now
  • Loading branch information
jimboca committed Jun 2, 2020
2 parents abe213d + c1f43d6 commit 1bc87aa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# __Changelog for Polyglot Python Interface v2__

### Version 2.0.41
- Remove call to basicConfig so referenced module logging will not show up which
is the behavior prior to 2.0.35
- Will add an option to put it back when I have time.

### Version 2.0.38-2.0.40
- Version changes while getting pypi automated releases to work

### Version 2.0.37
- Fixed bug for nodeservers that do not pass in name to polyinterface.Interface call.
- Added PyLogger class as suggested by @firstone
Expand Down
2 changes: 1 addition & 1 deletion polyinterface/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .polylogger import LOG_HANDLER,LOGGER
from .polyinterface import Interface, Node, Controller, unload_interface, get_network_interface

__version__ = '2.0.40'
__version__ = '2.0.41'
__description__ = 'UDI Polyglot v2 Interface'
__url__ = 'https://github.com/UniversalDevicesInc/polyglot-v2-python-interface'
__author__ = 'James Milne'
Expand Down
11 changes: 6 additions & 5 deletions polyinterface/polylogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ def __init__(self):
logging.captureWarnings(True)
self.set_log_format(PolyLogger.FMT_STRING)
# Attach the handler to the logger
logging.basicConfig(
handlers=[self.handler],
level=PolyLogger.LEVEL
)
#logging.basicConfig(
# handlers=[self.handler],
# level=PolyLogger.LEVEL
#)

self.logger = logging.getLogger(PolyLogger.NAME)
self.logger.propagate = False # If True we get duplicates?
self.logger.propagate = True
self.logger.addHandler(self.handler)
self.logger.setLevel(PolyLogger.LEVEL)

self.warnlog = logging.getLogger(PolyLogger.WARN_LOGGER_NAME)
warnings.formatwarning = self.warning_on_one_line
Expand Down

0 comments on commit 1bc87aa

Please sign in to comment.