Skip to content

Commit

Permalink
Storage: Adding None workaround val in metadata.end. Also importing l…
Browse files Browse the repository at this point in the history
…og.py functionality into storage and ingester.
  • Loading branch information
ABPLMC committed Jul 15, 2024
1 parent 7fb5e35 commit 60460d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
1 change: 0 additions & 1 deletion ingester/datalake_ingester/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
@click.pass_context
def cli(ctx, **kwargs):
conf = kwargs.pop('config')
# setup logging func
log_debugger(None, "datalake_ingester:cli.py before load_config", loc='datalake_ingester:cli.py:cli')
load_config(conf, DEFAULT_CONFIG, **kwargs)
log_debugger(None, "datalake_ingester:cli.py AFTER load_config", loc='datalake_ingester:cli.py:cli')
Expand Down
31 changes: 2 additions & 29 deletions ingester/datalake_ingester/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def log_debugger(logger=None, message='', loc='', conf=None):
if logger:
# Log at different levels
logger.info(f"======= Inside {loc} log_debugger logger.info: {message} =======\n")
logger.warning(f"======= Inside {loc} log_debugger logger.warning: {message} =======\n")


conf = {
'version': 1,
Expand All @@ -46,32 +48,3 @@ def log_debugger(logger=None, message='', loc='', conf=None):
}

log_debugger(conf=conf)

"""
def log_debugger(logger_type, message, loc=None):
print(f'=======Inside {loc} log_debugger print: at {message}=======')
if logger:
logger_type.info(f"=======Inside {loc} log_debugger logger.info=======")
logger_type.warning(f"=======Inside {loc} log_debugger logger.warning=======")
logger_type.error(f"=======Inside {loc} log_debugger logger.error=======")
logger_type.debug(f"=======Inside {loc} log_debugger logger.error=======")
else:
#setup logger
logger = logging.getLogger('test_logger')
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
logger.addHandler(ch)
logger.info(f"=======Inside {loc} log_debugger logger.info=======")
logger.warning(f"=======Inside {loc} log_debugger logger.warning=======")
logger.error(f"=======Inside {loc} log_debugger logger.error=======")
logger.debug(f"=======Inside {loc} log_debugger logger.error=======")
"""

# sentry_sdk.init()
# logging.config.dictConfig(conf)

0 comments on commit 60460d4

Please sign in to comment.