diff --git a/tmss_pycommon/util.py b/tmss_pycommon/util.py index cfce099efe428c646719405bd878fcdc7eeb4813..b4fc408fca0a3837d0b7fe123d4d963787ff780d 100644 --- a/tmss_pycommon/util.py +++ b/tmss_pycommon/util.py @@ -299,3 +299,10 @@ def without_keys(org_dict: dict, keys: typing.Collection) -> dict: def noop(): '''classic noop (no-operation) function that does nothing.''' pass + + +def configure_logging_and_timezone(debug_log_level: bool=False): + '''common method to have the same logging and timezone''' + # make sure we run in UTC timezone + os.environ['TZ'] = 'UTC' + logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.DEBUG if debug_log_level else logging.INFO)