# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
import logging
import os
import time

# function that help instantiating the logger. it requires the name of the log
def logger_setup(log_name):
    
    logger = logging.getLogger()
    logger.setLevel(logging.INFO)
    
    handler = logging.FileHandler(log_name)
    formatter = logging.Formatter("%(asctime)s %(levelname)s %(message)s")
    
    handler.setFormatter(formatter)
    logger.addHandler(handler)
    
    return logger

    
l = logger_setup("fileshistory.log")

# for everything in the current directory we log the creation and last modification time
for obj in os.listdir():
    l.info("FILEHISTORY "    + os.path.abspath(".") + "\\" + obj +   
            " CREATION "     + time.ctime(os.path.getctime(obj)) +
            " MODIFICATION " + time.ctime(os.path.getmtime(obj)))
# -



StarcoderdataJupyterScriptsDedupFiltered