Skip to content

Commit

Permalink
! v0.3.33
Browse files Browse the repository at this point in the history
  • Loading branch information
ALERTua committed Mar 6, 2024
1 parent a3f9e25 commit a88b537
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
History
=======

0.3.32 (2024-06-03)
0.3.33 (2024-06-03)
-------------------

* Precaution: fallback to UTC if local timezone raises an Exception
Expand Down
2 changes: 1 addition & 1 deletion global_logger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

__author__ = """Alexey Rubasheff"""
__email__ = '[email protected]'
__version__ = '0.3.32'
__version__ = '0.3.33'

from .global_logger import Log # noqa # pylint: disable=unused-import
13 changes: 8 additions & 5 deletions global_logger/global_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ def clear_message(msg):
return re.sub(r'\x1b(\[.*?[@-~]|\].*?(\x07|\x1b\\))', '', msg)


def tz():
try:
return pendulum.local_timezone()
except:
return pendulum.UTC


class InfoFilter(logging.Filter):
def filter(self, record):
return record.levelno <= logging.INFO
Expand Down Expand Up @@ -134,11 +141,7 @@ def __init__(self, name, level=None, global_level=True, logs_dir=None, log_sessi
Log.logs_dir.mkdir(parents=True)

if Log.log_session_filename is None:
try:
tz = pendulum.local_timezone()
except:
tz = pendulum.timezone('UTC')
now = pendulum.now(tz)
now = pendulum.now(tz=tz())
Log.log_session_filename = "%s.log" % now.strftime('%Y-%m-%d_%H-%M-%S')
self._clean_logs_folder()

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.3.32
current_version = 0.3.33
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/alertua/global_logger',
version='0.3.32',
version='0.3.33',
zip_safe=False,
)

0 comments on commit a88b537

Please sign in to comment.