Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 8f05fcc9

Přidáno uživatelem Michal Seják před téměř 4 roky(ů)

Re #8589 - Added a log check to test if the directory exists and if not, print error.

Zobrazit rozdíly:

src/utils/logger.py
11 11

  
12 12

  
13 13
def configure_logging(config: Configuration):
14
    if not os.path.exists(FileAnchor(config.root_dir, LOG_DIR).shortest_relative_path()):
14
    root_path = FileAnchor(config.root_dir, LOG_DIR).shortest_relative_path()
15
    if root_path is None:
16
        print(f"Critical error, '{config.root_dir}' does not exist in '{os.getcwd()}'.")
17
        exit(1)
18

  
19
    if not os.path.exists(root_path):
15 20
        os.makedirs(FileAnchor(config.root_dir, LOG_DIR).shortest_relative_path())
16 21

  
17 22
    handler = logging.handlers.TimedRotatingFileHandler(

Také k dispozici: Unified diff