Skip to content

Commit f97d715

Browse files
author
David Noble
committed
splunklib.searchcomands.logging update
Made logging instance based as it should be
1 parent 75421e8 commit f97d715

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

splunklib/searchcommands/logging.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import os
2121

2222

23-
def configure(cls, path=None):
23+
def configure(instance, path=None):
2424
""" Configure logging for the app containing a class and get its logger
2525
2626
This function expects a Splunk app directory structure:
@@ -51,6 +51,7 @@ def configure(cls, path=None):
5151
:type path: str or NoneType
5252
5353
"""
54+
cls = type(instance)
5455
logger_name = cls.__name__
5556
module = inspect.getmodule(cls)
5657
app_directory = os.path.dirname(os.path.dirname(module.__file__))

splunklib/searchcommands/search_command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __init__(self):
4040

4141
# Variables that may be used, but not altered by derived classes
4242

43-
self.logger, self._logging_configuration = logging.configure(type(self))
43+
self.logger, self._logging_configuration = logging.configure(self)
4444
self.input_header = InputHeader()
4545
self.messages = MessagesHeader()
4646

@@ -77,7 +77,7 @@ def logging_configuration(self):
7777
@logging_configuration.setter
7878
def logging_configuration(self, value):
7979
self.logger, self._logging_configuration = logging.configure(
80-
type(self), value)
80+
self, value)
8181
return
8282

8383
@Option

0 commit comments

Comments
 (0)