GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

setup()   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 22

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
c 2
b 0
f 0
dl 0
loc 22
rs 9.2
1
# -*- coding: utf-8 -*-
2
3
# Standard library imports
4
import logging.handlers
5
import os
6
7
# Local imports
8
from conda_manager.utils import get_conf_path
9
10
11
logfolder = os.path.join(get_conf_path(), 'logs')
12
logfile = os.path.join(logfolder, 'condamanager.log')
13
14
15
def setup():
16
    if not os.path.isdir(logfolder):
17
        os.mkdir(logfolder)
18
19
    logger = logging.getLogger('condamanager')
20
    logger.setLevel(logging.DEBUG)
21
22
#    ch = logging.handlers.RotatingFileHandler(logfile, maxBytes=2*1024*1024,
23
#                                              backupCount=5, mode='w')
24
    ch = logging.FileHandler(logfile, mode='w')
25
    ch.setLevel(logging.DEBUG)
26
27
    f = ('%(asctime)s - %(levelname)s\n'
28
         '    %(module)s.%(funcName)s : %(lineno)d\n'
29
         '    %(message)s\n')
30
    formatter = logging.Formatter(f)
31
    ch.setFormatter(formatter)
32
33
    logger.addHandler(ch)
34
35
    logger.info('Setting up logger')
36
    return logger
37
38
logger = setup()
39