コード例 #1
0
def _set_up_logging_from_environment():
    import logging
    import os
    from pytential.log import set_up_logging

    for level_name, level in (("DEBUG", logging.DEBUG), ("INFO", logging.INFO),
                              ("WARNING", logging.WARNING),
                              ("ERROR", logging.ERROR), ("CRITICAL",
                                                         logging.CRITICAL)):

        pytential_log_var = os.environ.get(f"PYTENTIAL_LOG_{level_name}")
        if pytential_log_var is not None:
            set_up_logging(pytential_log_var.split(":"), level=level)
コード例 #2
0
ファイル: __init__.py プロジェクト: inducer/pytential
def _set_up_logging_from_environment():
    import logging
    import os
    from pytential.log import set_up_logging

    for level_name, level in (
            ("DEBUG", logging.DEBUG),
            ("INFO", logging.INFO),
            ("WARNING", logging.WARNING),
            ("ERROR", logging.ERROR),
            ("CRITICAL", logging.CRITICAL)):

        pytential_log_var = os.environ.get("PYTENTIAL_LOG_%s" % level_name)
        if pytential_log_var is not None:
            set_up_logging(pytential_log_var.split(":"), level=level)