regta icon indicating copy to clipboard operation
regta copied to clipboard

Optional logger arg on jobs handler for functional styled code

Open SKY-ALIN opened this issue 2 years ago • 0 comments

Example:

from datetime import timedelta
from logging import Logger
import regta

@regta.async_job(timedelta(seconds=5))
async def my_basic_job(logger: Logger):
    logger.info("A intermediate message")
    return "The final logging message"

But the old style must be supported also:

from datetime import timedelta
import regta

@regta.async_job(timedelta(seconds=5))
async def my_basic_job():
    return "The final logging message"

SKY-ALIN avatar Jan 05 '23 04:01 SKY-ALIN