Skip to content
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

use standard python logging facilities #5

Open
heilgeirr opened this issue Jul 27, 2018 · 0 comments
Open

use standard python logging facilities #5

heilgeirr opened this issue Jul 27, 2018 · 0 comments

Comments

@heilgeirr
Copy link
Collaborator

heilgeirr commented Jul 27, 2018

class JDILogger (JDI.core.logger.jdi_logger.JDILogger) adds nothing useful to standard python logging facilities, and also sets up hardcoded log handler, issuing messages to jdi.log

modules that need logging can set up it as follows:

import logging
log = logging.getLogger(name) # for separate logger for every module

log.debug(….)
log.info(….)
log.exception(...)

Actual log destinations, formats, log levels can be set up by JDI package user using global logging config, which can be set up in client project code or in separate config file.

For python way to set up and configure logging please refer to following tutorials: https://docs.python.org/2/howto/logging.html, https://docs.python.org/3/howto/logging-cookbook.html.

For compatibility, JDI logger class could be implemented as follows:

class JDILogger(object):

def __init__(self, name="JDI Logger"):
    self.logger = logging.getLogger(name)

def __getattr__(self, name):
    return getattr(self.logger, name)
elv1s42 added a commit that referenced this issue Jan 28, 2019
use standard python logging facilities #5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant