Skip to content

Commit

Permalink
Merge branch 'function_case' into license_header
Browse files Browse the repository at this point in the history
  • Loading branch information
pem70 committed Jul 19, 2024
2 parents b01bba9 + 97e2599 commit a9b54eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
18 changes: 4 additions & 14 deletions src/core/zowe/core_for_zowe_sdk/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@


class Log:
"""Class used to represent a logger
"""
Class used to represent a logger.
Attributes
-------
----------
loggers: set
The set of all loggers
dirname: str
Expand All @@ -46,22 +47,11 @@ class Log:
file_handler.setFormatter(
logging.Formatter("[%(asctime)s] [%(levelname)s] [%(name)s] - %(message)s", "%m/%d/%Y %I:%M:%S %p")
)
console_handler = logging.StreamHandler()
console_handler: logging.StreamHandler = logging.StreamHandler()

file_output: bool = True
console_output: bool = True


class Log:
"""
Class used to represent a logger.
Attributes
----------
loggers: set
The set of all loggers
"""

loggers: set = set()

@staticmethod
Expand Down
6 changes: 2 additions & 4 deletions tests/unit/core/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

# Including necessary paths
import logging
import os
from unittest import mock

from pyfakefs.fake_filesystem_unittest import TestCase
from zowe.core_for_zowe_sdk.logger import Log
Expand Down Expand Up @@ -57,7 +55,7 @@ def test_all_loggers(self):

def test_console_handler(self):
Log.close_console_output()
test = Log.registerLogger("test")
test = Log.register_logger("test")
self.assertEqual(test.handlers[0], Log.file_handler)

Log.open_console_output()
Expand All @@ -68,7 +66,7 @@ def test_console_handler(self):

def test_file_handler(self):
Log.close_file_output()
test = Log.registerLogger("test")
test = Log.register_logger("test")
self.assertEqual(test.handlers[0], Log.console_handler)

Log.open_file_output()
Expand Down

0 comments on commit a9b54eb

Please sign in to comment.