File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 32
32
# modification, are permitted provided that the following conditions are met:
33
33
#
34
34
import os
35
+ import logging
35
36
36
37
from flask import Flask , jsonify
37
38
from flask_restful import Api
@@ -55,11 +56,14 @@ def create_app(test_config=None, provided_translator=None):
55
56
except OSError :
56
57
pass
57
58
59
+ level = os .environ .get ('LOG_LEVEL' , 'INFO' ).upper ()
60
+ app .logger .level = getattr (logging , level , None )
61
+
58
62
if test_config :
59
63
app .config .from_mapping (test_config )
60
64
else :
61
65
if 'CODEGEN_CONFIG_FILE' in os .environ :
62
- print ( 'Read Transformer Image on Init: ' , os .environ .get ('TRANSFORMER_SCIENCE_IMAGE' ))
66
+ app . logger . info ( os .environ .get ('TRANSFORMER_SCIENCE_IMAGE' ))
63
67
app .config .from_envvar ('CODEGEN_CONFIG_FILE' )
64
68
65
69
with app .app_context ():
You can’t perform that action at this time.
0 commit comments