web2py.py -e
This commit is contained in:
+7
-5
@@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
| This file is part of the web2py Web Framework
|
| This file is part of the web2py Web Framework
|
||||||
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
|
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
|
||||||
@@ -20,9 +19,10 @@ import types
|
|||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from storage import Storage
|
from gluon.storage import Storage
|
||||||
from http import HTTP
|
from gluon.http import HTTP
|
||||||
from html import BEAUTIFY, XML
|
from gluon.html import BEAUTIFY, XML
|
||||||
|
from gluon.settings import global_settings
|
||||||
|
|
||||||
logger = logging.getLogger("web2py")
|
logger = logging.getLogger("web2py")
|
||||||
|
|
||||||
@@ -156,7 +156,6 @@ class RestrictedError(Exception):
|
|||||||
"""
|
"""
|
||||||
Logs the exception.
|
Logs the exception.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
d = {
|
d = {
|
||||||
'layer': str(self.layer),
|
'layer': str(self.layer),
|
||||||
@@ -167,11 +166,14 @@ class RestrictedError(Exception):
|
|||||||
}
|
}
|
||||||
ticket_storage = TicketStorage(db=request.tickets_db)
|
ticket_storage = TicketStorage(db=request.tickets_db)
|
||||||
ticket_storage.store(request, request.uuid.split('/', 1)[1], d)
|
ticket_storage.store(request, request.uuid.split('/', 1)[1], d)
|
||||||
|
if global_settings.cmd_options.print_errors:
|
||||||
|
logger.error(self.traceback)
|
||||||
return request.uuid
|
return request.uuid
|
||||||
except:
|
except:
|
||||||
logger.error(self.traceback)
|
logger.error(self.traceback)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def load(self, request, app, ticket_id):
|
def load(self, request, app, ticket_id):
|
||||||
"""
|
"""
|
||||||
Loads a logged exception.
|
Loads a logged exception.
|
||||||
|
|||||||
@@ -737,6 +737,13 @@ def console():
|
|||||||
default=False,
|
default=False,
|
||||||
help='disable all output')
|
help='disable all output')
|
||||||
|
|
||||||
|
parser.add_option('-e',
|
||||||
|
'--errors_to_console',
|
||||||
|
action='store_true',
|
||||||
|
dest='print_errors',
|
||||||
|
default=False,
|
||||||
|
help='log all errors to console')
|
||||||
|
|
||||||
msg = ('set debug output level (0-100, 0 means all, 100 means none; '
|
msg = ('set debug output level (0-100, 0 means all, 100 means none; '
|
||||||
'default is 30)')
|
'default is 30)')
|
||||||
parser.add_option('-D',
|
parser.add_option('-D',
|
||||||
|
|||||||
Reference in New Issue
Block a user