Commit 78a84ed8 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[fix] get __main__ handler always

parent a2b69678
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ from ivas_processing_scripts.utils import (

def logging_init(args, cfg):
    """set up logging for a test file"""
    logger = logging.getLogger("ivas_processing_scripts")
    logger = logging.getLogger("__main__")
    logger.setLevel(logging.DEBUG)

    # console handler
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ from ivas_processing_scripts.utils import create_dir

def logging_init(args, cfg):
    """set up logging for a test file"""
    logger = logging.getLogger("ivas_processing_scripts.generation")
    logger = logging.getLogger("__main__")
    logger.setLevel(logging.DEBUG)

    # console handler
+2 −3
Original line number Diff line number Diff line
@@ -431,13 +431,12 @@ def process_item(
        chain, pairwise(processing_paths), processing_paths_meta[:-1]
    ):
        # setup logging for the output
        item_logger = logger.getChild(output.stem)
        fh = logging.FileHandler(output.with_suffix(".log"), mode="w")
        fh.setLevel(logging.DEBUG)
        fh.setFormatter(logging.Formatter(LOGGER_FORMAT, datefmt=LOGGER_DATEFMT))
        item_logger.addHandler(fh)
        logger.addHandler(fh)

        p.process(input, output, input_meta, item_logger)
        p.process(input, output, input_meta, logger)

    # copy output and metadata from final process to output file
    if not chain[-1].name == "processing_splitting_scaling":