diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 36fca6b..1629245 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,11 +15,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.7, 3.8 ] + python-version: [ 3.11 ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install pylint @@ -32,11 +32,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.7, 3.8 ] + python-version: [ 3.11 ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install pytest @@ -44,7 +44,7 @@ jobs: - name: Test with pytest run: pytest -v --doctest-modules --cov=./ - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v5 with: fail_ci_if_error: true @@ -52,11 +52,11 @@ jobs: needs: test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - uses: actions/checkout@v4 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.11 - name: Install twine run: pip install twine wheel - name: Build package diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 676c8cb..35f0f1d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,11 +15,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.7, 3.8 ] + python-version: [ 3.11 ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install pylint @@ -32,11 +32,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.7, 3.8 ] + python-version: [ 3.11 ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install pytest @@ -44,6 +44,6 @@ jobs: - name: Test with pytest run: pytest -v --doctest-modules --cov=./ - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v5 with: fail_ci_if_error: true diff --git a/QLog/__init__.py b/QLog/__init__.py index 3c2944a..82e42a3 100644 --- a/QLog/__init__.py +++ b/QLog/__init__.py @@ -43,7 +43,7 @@ def QLogError(data): log(LogLevel.ERROR, data) -loggers: [Logger] = [] +loggers: list[Logger] = [] def log(level: LogLevel, data): diff --git a/QLog/azure_system_logger.py b/QLog/azure_system_logger.py index 711ab9c..4bd6d19 100644 --- a/QLog/azure_system_logger.py +++ b/QLog/azure_system_logger.py @@ -14,9 +14,9 @@ def __init__(self, log_level=LogLevel.INFO): self.log_level = log_level if self.log_level is LogLevel.INFO: logging.getLogger().setLevel(logging.INFO) - if self.log_level is LogLevel.WARNING: + elif self.log_level is LogLevel.WARNING: logging.getLogger().setLevel(logging.WARNING) - if self.log_level is LogLevel.ERROR: + elif self.log_level is LogLevel.ERROR: logging.getLogger().setLevel(logging.ERROR) else: logging.getLogger().setLevel(logging.DEBUG) diff --git a/QLog/console_logger.py b/QLog/console_logger.py index 8bc73cc..5f0c4c6 100644 --- a/QLog/console_logger.py +++ b/QLog/console_logger.py @@ -11,7 +11,7 @@ class ConsoleLogger(Logger): def __init__(self, log_level=LogLevel.HIGHLIGHT): self.log_level = log_level - escape = u'\u001b' + escape = '\u001b' ansi_bold = '1m' ansi_reset = '0m' ansi_text_color = '37m' diff --git a/QLog/log_level.py b/QLog/log_level.py index c18b100..af481ae 100644 --- a/QLog/log_level.py +++ b/QLog/log_level.py @@ -22,7 +22,7 @@ def ansi_color(self): def ansi_color_sequence(self): """ Returns ANSI color sequence """ - return u'\u001b' + '[' + str(self.ansi_color) + return '\u001b[' + str(self.ansi_color) @property def python_log_level(self): diff --git a/QLog/system_logger.py b/QLog/system_logger.py index 8d81d85..12445b2 100644 --- a/QLog/system_logger.py +++ b/QLog/system_logger.py @@ -14,9 +14,9 @@ def __init__(self, log_level=LogLevel.INFO): self.log_level = log_level if self.log_level is LogLevel.INFO: logging.getLogger().setLevel(logging.INFO) - if self.log_level is LogLevel.WARNING: + elif self.log_level is LogLevel.WARNING: logging.getLogger().setLevel(logging.WARNING) - if self.log_level is LogLevel.ERROR: + elif self.log_level is LogLevel.ERROR: logging.getLogger().setLevel(logging.ERROR) else: logging.getLogger().setLevel(logging.DEBUG)