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

Changed logger to use module name #479

Merged
merged 1 commit into from
Sep 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fedmsg/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self):
self.extra_args = []
self.config = self.get_config()
dictConfig(self.config.get('logging', {'version': 1}))
self.log = logging.getLogger("fedmsg")
self.log = logging.getLogger(__name__)

def get_config(self):
return fedmsg.config.load_config(
Expand Down
4 changes: 2 additions & 2 deletions fedmsg/consumers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class FedmsgConsumer(moksha.hub.api.consumer.Consumer):
def __init__(self, hub):
module = inspect.getmodule(self).__name__
name = self.__class__.__name__
self.log = logging.getLogger("fedmsg")
self.log = logging.getLogger(__name__)

if not self.config_key:
raise ValueError("%s:%s must declare a 'config_key'" % (
Expand All @@ -112,7 +112,7 @@ def __init__(self, hub):
super(FedmsgConsumer, self).__init__(hub)

# Now, re-get our logger to override the one moksha assigns us.
self.log = logging.getLogger("fedmsg")
self.log = logging.getLogger(__name__)

if self.validate_signatures is None:
self.validate_signatures = self.hub.config['validate_signatures']
Expand Down
2 changes: 1 addition & 1 deletion fedmsg/consumers/dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ def __init__(self, hub):

def consume(self, msg):
# Do nothing.
log = logging.getLogger("moksha.hub")
log = logging.getLogger(__name__)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is missing test coverage.

log.debug("Duhhhh... got: %r" % msg)
2 changes: 1 addition & 1 deletion fedmsg/consumers/ircbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def __init__(self, channel, nickname, filters,
self.rate = rate
self.parent_consumer = parent_consumer
self.ready = ready
self.log = logging.getLogger("moksha.hub")
self.log = logging.getLogger(__name__)

def startedConnecting(self, connector):
if self.ready:
Expand Down
2 changes: 1 addition & 1 deletion fedmsg/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class FedMsgContext(object):

def __init__(self, **config):
super(FedMsgContext, self).__init__()
self.log = logging.getLogger("fedmsg")
self.log = logging.getLogger(__name__)

self.c = config
self.hostname = socket.gethostname().split('.', 1)[0]
Expand Down
2 changes: 1 addition & 1 deletion fedmsg/meta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
from fedmsg.meta.default import DefaultProcessor # noqa: E402
from fedmsg.meta.base import BaseConglomerator # noqa: E402

log = logging.getLogger("fedmsg")
log = logging.getLogger(__name__)


class ProcessorsNotInitialized(Exception):
Expand Down