Skip to content

Commit

Permalink
turning off logger for SdkApi
Browse files Browse the repository at this point in the history
Signed-off-by: aadityasinha-dotcom <[email protected]>
  • Loading branch information
aadityasinha-dotcom committed Aug 20, 2024
1 parent 59d3aad commit 9d3b834
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/core/zowe/core_for_zowe_sdk/sdk_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ class SdkApi:
Name of the logger (same as the filename by default)
"""

def __init__(self, profile: dict, default_url: str, logger_name: str = __name__):
def __init__(self, profile: dict, default_url: str, logger_name: str = __name__, log = False):
session = Session(profile)
self.session: ISession = session.load()

self.logger = Log.register_logger(logger_name)

if log == False:
Log.close(logger)

self._default_service_url = default_url
self._default_headers = {
"Content-Type": "application/json",
Expand Down
2 changes: 1 addition & 1 deletion src/zos_console/zowe/zos_console_for_zowe_sdk/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Console(SdkApi):
A profile in dict (json) format
"""

def __init__(self, connection: dict):
def __init__(self, connection: dict, log = False):
super().__init__(connection, "/zosmf/restconsoles/consoles/defcn", logger_name=__name__)

def issue_command(self, command: str, console: Optional[str] = None) -> IssueCommandResponse:
Expand Down
2 changes: 1 addition & 1 deletion src/zos_files/zowe/zos_files_for_zowe_sdk/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class Datasets(SdkApi):
A profile for connection in dict (json) format
"""

def __init__(self, connection: dict):
def __init__(self, connection: dict, log = False):
super().__init__(connection, "/zosmf/restfiles/", logger_name=__name__)
self._default_headers["Accept-Encoding"] = "gzip"

Expand Down
2 changes: 1 addition & 1 deletion src/zos_files/zowe/zos_files_for_zowe_sdk/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Files(SdkApi):
uss: USSFiles
fs: FileSystems

def __init__(self, connection: dict):
def __init__(self, connection: dict, log = False):
super().__init__(connection, "/zosmf/restfiles/", logger_name=__name__)
self._default_headers["Accept-Encoding"] = "gzip"
self.ds = Datasets(connection)
Expand Down

0 comments on commit 9d3b834

Please sign in to comment.