I am trying to apply logging to Jupyter Notebook's display(df) functionality. How do I edit the last line of my code so that the dataframe is only displayed if logging INFO is active? Currently it's shown whether the logging is active or inactive.
import pandas as pd
logging.basicConfig(level=logging.INFO, format=' %(asctime)s - %(levelname)s - %(message)s')
filename = 'test.csv'
df=pd.read_csv(filename, index_col=None, encoding='utf-8')
logging.info(display(df))