New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid duplicate logging to both stderr and NSLog #476

Merged
merged 1 commit into from Jan 29, 2017

Conversation

Projects
None yet
2 participants
@lenlo
Contributor

lenlo commented Jan 29, 2017

When turning on debug logging on a Mac, log output would both go to NSLog as well as stderr, thus duplicating all log entries if you were to ran the app from the command line. Fixed by supplying our NSLog based log handler directly to the python logger.

Avoid duplicate logging to both stderr and NSLog
...by supplying our NSLog-based handler directly to basicConfig so that it
won't automatically create a stderr-based one.

@hsoft hsoft self-requested a review Jan 29, 2017

@hsoft

hsoft approved these changes Jan 29, 2017

@@ -41,9 +41,9 @@
class PyMoneyGuruApp(PyBaseApp):
def __init__(self):
LOGGING_LEVEL = logging.DEBUG if proxy.prefValue_('DebugMode') else logging.WARNING
logging.basicConfig(level=LOGGING_LEVEL, format='%(levelname)s %(message)s')
logging.basicConfig(level=LOGGING_LEVEL, format='%(levelname)s %(message)s',
handlers=[CocoaHandler()])

This comment has been minimized.

@hsoft

hsoft Jan 29, 2017

Owner

Hey! that's a new feature I've missed from the py3.3 changelog (the handlers kwarg). Much easier this way.

@hsoft

hsoft Jan 29, 2017

Owner

Hey! that's a new feature I've missed from the py3.3 changelog (the handlers kwarg). Much easier this way.

@hsoft hsoft merged commit c6833d1 into hsoft:master Jan 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment