Is there any way to use the some logging basicConfig across the Trainer object?

I’m currently using logging and the Trainer as follows:

from accelerate.logging import get_logger
from transformers import Trainer


logger = get_logger()

def main():
    logging.basicConfig()
    # Some code.
    trainer = Trainer()
    trainer.train()

What I’m noticing is that the logging formats are different for my main script and from within the Trainer. I’m assuming that this is because the Trainer module has its own logger initialized from Python’s logging module at the very top, and therefore my main script’s configurations aren’t transferring over.

Is there a way that I can make sure the logging is consistent?