Merge "Add debug env variable"
This commit is contained in:
commit
d4187028fe
@ -14,6 +14,7 @@
|
|||||||
# along with this software. If not, see <http://www.gnu.org/licenses/>.
|
# along with this software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import logging
|
import logging
|
||||||
import cherrypy
|
import cherrypy
|
||||||
@ -333,10 +334,11 @@ def main():
|
|||||||
help='Command: serve, prune',
|
help='Command: serve, prune',
|
||||||
default='serve')
|
default='serve')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
if args.debug:
|
logformat = '%(levelname)s %(name)s: %(message)s'
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
if args.debug or os.environ.get('DEBUG') == '1':
|
||||||
|
logging.basicConfig(level=logging.DEBUG, format=logformat)
|
||||||
else:
|
else:
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO, format=logformat)
|
||||||
cherrypy.log.access_log.propagate = False
|
cherrypy.log.access_log.propagate = False
|
||||||
logging.getLogger("requests").setLevel(logging.DEBUG)
|
logging.getLogger("requests").setLevel(logging.DEBUG)
|
||||||
logging.getLogger("keystoneauth").setLevel(logging.ERROR)
|
logging.getLogger("keystoneauth").setLevel(logging.ERROR)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user