Commit 88927ba8 by Oleksandr Barabash

logger. tag added to message

parent 449644aa
...@@ -61,10 +61,11 @@ class Log(object): ...@@ -61,10 +61,11 @@ class Log(object):
@staticmethod @staticmethod
def log(level, tag, message, ex): def log(level, tag, message, ex):
# The tab should be the module.__name__ but not required! # The tab should be the module.__name__ but not required!
msg = "{}::{}".format(tag, message)
if ex is not None: if ex is not None:
# exc_type, exc_value, exc_traceback = sys.exc_info() # exc_type, exc_value, exc_traceback = sys.exc_info()
message = "%s\nTraceback:\n%s" % (message, traceback.format_exc()) message = "%s\nTraceback:\n%s" % (msg, traceback.format_exc())
logging.getLogger(tag).log(level, message) logging.getLogger(tag).log(level, msg)
@staticmethod @staticmethod
def v(tag, message, ex=None): def v(tag, message, ex=None):
......
Metadata-Version: 2.1 Metadata-Version: 2.1
Name: s1zlibs Name: s1zlibs
Version: 1.0.7 Version: 1.0.8
Summary: s1zlibs Summary: s1zlibs
Home-page: https://git.s1z.info/skal/s1zlibs Home-page: https://git.s1z.info/skal/s1zlibs
Author: Barabash Oleksandr Author: Barabash Oleksandr
......
...@@ -61,10 +61,11 @@ class Log(object): ...@@ -61,10 +61,11 @@ class Log(object):
@staticmethod @staticmethod
def log(level, tag, message, ex): def log(level, tag, message, ex):
# The tab should be the module.__name__ but not required! # The tab should be the module.__name__ but not required!
msg = "{}::{}".format(tag, message)
if ex is not None: if ex is not None:
# exc_type, exc_value, exc_traceback = sys.exc_info() # exc_type, exc_value, exc_traceback = sys.exc_info()
message = "%s\nTraceback:\n%s" % (message, traceback.format_exc()) message = "%s\nTraceback:\n%s" % (msg, traceback.format_exc())
logging.getLogger(tag).log(level, message) logging.getLogger(tag).log(level, msg)
@staticmethod @staticmethod
def v(tag, message, ex=None): def v(tag, message, ex=None):
......
...@@ -5,7 +5,7 @@ with open("README.md", "r") as fh: ...@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setuptools.setup( setuptools.setup(
name="s1zlibs", name="s1zlibs",
version="1.0.7", version="1.0.8",
author="Barabash Oleksandr", author="Barabash Oleksandr",
author_email="skaltmn@gmail.com", author_email="skaltmn@gmail.com",
description="s1zlibs", description="s1zlibs",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment