# Path: config.py
# DEBUG = True
# 
# CONSOLE_DEBUG_LEVEL = logging.DEBUG
# 
# LOG_DIRECTORY = '_log'
# 
# FORMAT_LOGS = '%(asctime)s %(name)-14s %(levelname)-8s %(message)s'


import logging
from os import path
from config import DEBUG, CONSOLE_DEBUG_LEVEL, LOG_DIRECTORY, FORMAT_LOGS
        logging.getLogger('').setLevel(logging.INFO)

    # Database
    loggingdb = logging.getLogger('sqlalchemy.engine')
    loggingdb.setLevel(logging.WARNING)
    handler_logdb = logging.FileHandler(path.join(chemin, '..', LOG_DIRECTORY, 'db.log'))
    handler_logdb.setFormatter(formatter)
    loggingdb.addHandler(handler_logdb)

    # API Server
    loggingserver = logging.getLogger('api')
    handler_logapi = logging.FileHandler(path.join(chemin, '..', LOG_DIRECTORY, 'api.log'))
    handler_logapi.setFormatter(formatter)
    loggingserver.addHandler(handler_logapi)

    # IOCScanners
    loggingiocscan = logging.getLogger('iocscanner')
    handler_logiocscan = logging.FileHandler(path.join(chemin, '..', LOG_DIRECTORY, 'iocscanners.log'))
    handler_logiocscan.setFormatter(formatter)
    loggingiocscan.addHandler(handler_logiocscan)
    
     # Hashscanners
    logginghashscan = logging.getLogger('hashscanner')
    handler_loghashscan = logging.FileHandler(path.join(chemin, '..', LOG_DIRECTORY, 'hashscanners.log'))
    handler_loghashscan.setFormatter(formatter)
    logginghashscan.addHandler(handler_loghashscan)
    
    # Console output
    # define a Handler which writes INFO messages or higher to the sys.stderr
    console = logging.StreamHandler()

# Path: config.py
# DEBUG = True
# 
# CONSOLE_DEBUG_LEVEL = logging.DEBUG
# 
# LOG_DIRECTORY = '_log'
# 
# FORMAT_LOGS = '%(asctime)s %(name)-14s %(levelname)-8s %(message)s'


# Path: helpers/log.py
import logging
from os import path
from config import DEBUG, CONSOLE_DEBUG_LEVEL, LOG_DIRECTORY, FORMAT_LOGS

        logging.getLogger('').setLevel(logging.INFO)

    # Database
    loggingdb = logging.getLogger('sqlalchemy.engine')
    loggingdb.setLevel(logging.WARNING)
    handler_logdb = logging.FileHandler(path.join(chemin, '..', LOG_DIRECTORY, 'db.log'))
    handler_logdb.setFormatter(formatter)
    loggingdb.addHandler(handler_logdb)

    # API Server
    loggingserver = logging.getLogger('api')
    handler_logapi = logging.FileHandler(path.join(chemin, '..', LOG_DIRECTORY, 'api.log'))
    handler_logapi.setFormatter(formatter)
    loggingserver.addHandler(handler_logapi)

    # IOCScanners
    loggingiocscan = logging.getLogger('iocscanner')
    handler_logiocscan = logging.FileHandler(path.join(chemin, '..', LOG_DIRECTORY, 'iocscanners.log'))
    handler_logiocscan.setFormatter(formatter)
    loggingiocscan.addHandler(handler_logiocscan)
    
     # Hashscanners
    logginghashscan = logging.getLogger('hashscanner')
    handler_loghashscan = logging.FileHandler(path.join(chemin, '..', LOG_DIRECTORY, 'hashscanners.log'))
    handler_loghashscan.setFormatter(formatter)
    logginghashscan.addHandler(handler_loghashscan)
    
    # Console output
    # define a Handler which writes INFO messages or higher to the sys.stderr
    console = logging.StreamHandler()

    console.setLevel(CONSOLE_DEBUG_LEVEL)