aboutsummaryrefslogtreecommitdiff
blob: 59b16096fdec7044bd6ff5a789e26b43b9f28119 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os
from errno import *
import logging as log
import config

def init_logging():
    """Initialize logging file and settings
    """
    try:
        os.mkdir(config.CHROOT_LOGS)
    except OSError, e:
        if e.errno != EEXIST:
            raise e

    log.basicConfig(level=config.LOG_LEVEL, format='%(asctime)s %(levelname)s %(message)s', 
            filename=config.CHROOT_LOGS+'/tinderbox.log', filemode='w')