Skip to content

Commit

Permalink
logger wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Amit Jaiswal committed Sep 2, 2024
1 parent 4c123e1 commit f9f7454
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python-packages/core/src/omigo_core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def is_error():
return str(os.environ.get(OMIGO_ERROR, "1")) == "1"

def is_warn():
return str(os.environ.get(OMIGO_WARN, "1")) == "1"
return str(os.environ.get(OMIGO_WARN, "0")) == "1"

def is_info():
return str(os.environ.get(OMIGO_INFO, "1")) == "1"
Expand Down Expand Up @@ -697,3 +697,10 @@ def convert_ipv4_to_hex(ip):
# return
return hex_parts.replace('0x', '')

def logger_info(logger, msg):
if (is_info()):
logger.info(msg)

def logger_warn(logger, msg):
if (is_warn()):
logger.warn(msg)

0 comments on commit f9f7454

Please sign in to comment.