fmi-faim / faim-ipa

A collection of Image Processing and Analysis (IPA) functions used at the Facility for Advanced Imaging and Microscopy (FAIM)
BSD 3-Clause "New" or "Revised" License
9 stars 6 forks source link

Logging with decorator #179

Closed tibuch closed 3 weeks ago

tibuch commented 2 months ago

Copied from here.

my_logger = create_logger(name="processing")

@log(logger=my_logger)
def run_processing(input_dir: str, output_dir: str):
    # do some processing
    my_logger.info("Done!")

We should start a example collection to keep track of these tips and tricks!

imagejan commented 3 weeks ago

We decided this pattern (@log annotation with custom logger to be provided) is too over-engineered for our current use cases.