-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
25 lines (20 loc) · 736 Bytes
/
app.py
File metadata and controls
25 lines (20 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
@author: sharpdeep
@file:app.py
@time: 2016-01-01 23:11
"""
from flask import Flask
from conf.config import configs
import logging
from logging.handlers import RotatingFileHandler
logger = logging.getLogger(configs.app.log.name)
logfileHandler = RotatingFileHandler(configs.app.log.logFile,
maxBytes=configs.app.log.maxBytes,
backupCount=configs.app.log.backupCount)
logfileHandler.setFormatter(logging.Formatter('[%(asctime)s] %(levelname)s "%(message)s"'))
logfileHandler.setLevel(configs.app.log.logLevel)
logger.addHandler(logfileHandler)
logger.setLevel(configs.app.log.logLevel)
app = Flask(__name__)