Archived
StreamHandler does not accept the 'stream' keyword argument even though the docs say so.
This commit is contained in:
1 parent
0c6af0271d
commit
01a8839fcf
1 file changed
+7
-8
+7
-8
@@ -15,14 +15,13 @@ app = Flask(__name__)
|
||||
app.config.from_object('config')
|
||||
app.json_encoder = CustomJSONEncoder
|
||||
|
||||
# if not app.debug:
|
||||
# import logging
|
||||
# from logging import StreamHandler
|
||||
# handler = StreamHandler(stream=sys.stderr)
|
||||
# formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
||||
# handler.setFormatter(formatter)
|
||||
# handler.setLevel(logging.INFO)
|
||||
# app.logger.addHandler(handler)
|
||||
if not app.debug:
|
||||
import logging
|
||||
handler = logging.StreamHandler()
|
||||
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
||||
handler.setFormatter(formatter)
|
||||
handler.setLevel(logging.INFO)
|
||||
app.logger.addHandler(handler)
|
||||
|
||||
def connect_db():
|
||||
"""Connects to our database."""
|
||||
|
||||
Reference in new issue
Block a user