Skip to content

Commit 595f791

Browse files
committed
logs enabled
1 parent a81b2ee commit 595f791

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

servicex_codegen/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
# modification, are permitted provided that the following conditions are met:
3333
#
3434
import os
35+
import logging
3536

3637
from flask import Flask, jsonify
3738
from flask_restful import Api
@@ -55,11 +56,14 @@ def create_app(test_config=None, provided_translator=None):
5556
except OSError:
5657
pass
5758

59+
level = os.environ.get('LOG_LEVEL', 'INFO').upper()
60+
app.logger.level = getattr(logging, level, None)
61+
5862
if test_config:
5963
app.config.from_mapping(test_config)
6064
else:
6165
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'))
6367
app.config.from_envvar('CODEGEN_CONFIG_FILE')
6468

6569
with app.app_context():

0 commit comments

Comments
 (0)