|
|
@ -32,14 +32,6 @@ LOG_LEVEL_MAP = dict([ |
|
|
|
]) |
|
|
|
DEFAULT_LOG_LEVEL = 'warn' |
|
|
|
|
|
|
|
DEFAULT_TRANSPORT = 'threaded' |
|
|
|
TRANSPORT_CLASS_MAP = { |
|
|
|
'requests_synchronous': raven.transport.RequestsHTTPTransport, |
|
|
|
'requests_threaded': raven.transport.ThreadedRequestsHTTPTransport, |
|
|
|
'synchronous': raven.transport.HTTPTransport, |
|
|
|
'threaded': raven.transport.ThreadedHTTPTransport, |
|
|
|
} |
|
|
|
|
|
|
|
ODOO_USER_EXCEPTIONS = [ |
|
|
|
'odoo.exceptions.AccessDenied', |
|
|
|
'odoo.exceptions.AccessError', |
|
|
@ -64,21 +56,34 @@ EXCLUDE_LOGGERS = ( |
|
|
|
) |
|
|
|
DEFAULT_EXCLUDE_LOGGERS = ','.join(EXCLUDE_LOGGERS) |
|
|
|
|
|
|
|
SENTRY_OPTIONS = [ |
|
|
|
SentryOption('dsn', '', str.strip), |
|
|
|
SentryOption('install_sys_hook', False, None), |
|
|
|
SentryOption('transport', DEFAULT_TRANSPORT, TRANSPORT_CLASS_MAP.get), |
|
|
|
SentryOption('include_paths', '', split_multiple), |
|
|
|
SentryOption('exclude_paths', '', split_multiple), |
|
|
|
SentryOption('machine', defaults.NAME, None), |
|
|
|
SentryOption('auto_log_stacks', defaults.AUTO_LOG_STACKS, None), |
|
|
|
SentryOption('capture_locals', defaults.CAPTURE_LOCALS, None), |
|
|
|
SentryOption('string_max_length', defaults.MAX_LENGTH_STRING, None), |
|
|
|
SentryOption('list_max_length', defaults.MAX_LENGTH_LIST, None), |
|
|
|
SentryOption('site', None, None), |
|
|
|
SentryOption('include_versions', True, None), |
|
|
|
SentryOption( |
|
|
|
'ignore_exceptions', DEFAULT_IGNORED_EXCEPTIONS, split_multiple), |
|
|
|
SentryOption('processors', DEFAULT_PROCESSORS, split_multiple), |
|
|
|
SentryOption('environment', None, None), |
|
|
|
] |
|
|
|
DEFAULT_TRANSPORT = 'threaded' |
|
|
|
|
|
|
|
|
|
|
|
def select_transport(name=DEFAULT_TRANSPORT): |
|
|
|
return { |
|
|
|
'requests_synchronous': raven.transport.RequestsHTTPTransport, |
|
|
|
'requests_threaded': raven.transport.ThreadedRequestsHTTPTransport, |
|
|
|
'synchronous': raven.transport.HTTPTransport, |
|
|
|
'threaded': raven.transport.ThreadedHTTPTransport, |
|
|
|
}.get(name, DEFAULT_TRANSPORT) |
|
|
|
|
|
|
|
|
|
|
|
def get_sentry_options(): |
|
|
|
return [ |
|
|
|
SentryOption('dsn', '', str.strip), |
|
|
|
SentryOption('install_sys_hook', False, None), |
|
|
|
SentryOption('transport', DEFAULT_TRANSPORT, select_transport), |
|
|
|
SentryOption('include_paths', '', split_multiple), |
|
|
|
SentryOption('exclude_paths', '', split_multiple), |
|
|
|
SentryOption('machine', defaults.NAME, None), |
|
|
|
SentryOption('auto_log_stacks', defaults.AUTO_LOG_STACKS, None), |
|
|
|
SentryOption('capture_locals', defaults.CAPTURE_LOCALS, None), |
|
|
|
SentryOption('string_max_length', defaults.MAX_LENGTH_STRING, None), |
|
|
|
SentryOption('list_max_length', defaults.MAX_LENGTH_LIST, None), |
|
|
|
SentryOption('site', None, None), |
|
|
|
SentryOption('include_versions', True, None), |
|
|
|
SentryOption( |
|
|
|
'ignore_exceptions', DEFAULT_IGNORED_EXCEPTIONS, split_multiple), |
|
|
|
SentryOption('processors', DEFAULT_PROCESSORS, split_multiple), |
|
|
|
SentryOption('environment', None, None), |
|
|
|
] |