Browse Source

[FIX] fix travis build

pull/777/head
Sébastien BEAU 8 years ago
parent
commit
d0e27fbcdc
  1. 2
      logging_json/__openerp__.py
  2. 14
      logging_json/json_log.py
  3. 1
      requirements.txt

2
logging_json/__openerp__.py

@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
{'name': 'JSON Logging',
'version': '9.0.1.0.0',
'version': '8.0.1.0.0',
'author': 'Camptocamp,Akretion,Odoo Community Association (OCA)',
'license': 'AGPL-3',
'category': 'Extra Tools',

14
logging_json/json_log.py

@ -24,30 +24,30 @@ except ImportError:
def is_true(strval):
return bool(strtobool(strval or '0'.lower()))
# The following regex are use to extract information from native odoo log
# We struct is the following
# {name_of_the_log : [regex, formatter, extra_vals]}
# The extra_vals "dict" will be merged into the jsonlogger if the regex match
# In order to make understandable the regex please add an string example that
# match
REGEX = {
'openerp.addons.base.ir.ir_cron': [
# "cron.object.execute('db', 1, '*', u'base.action.rule', u'_check')"
("cron\.object\.execute\('.+'(?P<cron_model>[\w.]+).+"
"'(?P<cron_method>[\w.]+)'\)",
(r"cron\.object\.execute\('.+'(?P<cron_model>[\w.]+).+"
r"'(?P<cron_method>[\w.]+)'\)",
{}, {'cron_running': True}),
# "0.016s (base.action.rule, _check)"
("(?P<cron_duration_second>[\d.]+)s \("
"(?P<cron_model>[\w.]+), (?P<cron_method>[\w.]+)",
(r"(?P<cron_duration_second>[\d.]+)s \("
r"(?P<cron_model>[\w.]+), (?P<cron_method>[\w.]+)",
{'cron_duration_second': float},
{'cron_running': False, 'cron_status': 'succeeded'}),
# Call of self.pool.get('base.action.rule')._check(
# cr, uid, *u'()') failed in Job 43
("Call of self\.pool\.get\('(?P<cron_model>[\w.]+)'\)"
".(?P<cron_method>[\w.]+)",
(r"Call of self\.pool\.get\('(?P<cron_model>[\w.]+)'\)"
r".(?P<cron_method>[\w.]+)",
{}, {'cron_running': False, 'cron_status': 'failed'}),
],
}

1
requirements.txt

@ -4,3 +4,4 @@
pysftp
acme_tiny
IPy
python-json-logger
Loading…
Cancel
Save