Permalink
Browse files

[REV] base: revert rename ir.logging type to logging_type

This reverts commit c42a130
and commit fb7ac56.

The runbot is using cross db logging and those commit were breaking the
mechanism. As a result, the master builds logs were empty.
If we update the runbot to use logging_type instead, the other versions
builds will be impacted hence this revert.

closes #28512
  • Loading branch information...
d-fence committed Nov 8, 2018
1 parent ecedd77 commit e9e864802f2d419403aba2c45a0c0f00c02e4cbe
@@ -174,7 +174,7 @@ def log_xml(self, xml_string, func):
env = api.Environment(cr, SUPERUSER_ID, {})
IrLogging = env['ir.logging']
IrLogging.sudo().create({'name': 'delivery.carrier',
'logging_type': 'server',
'type': 'server',
'dbname': db_name,
'level': 'DEBUG',
'message': xml_string,
@@ -507,7 +507,7 @@ def _get_eval_context(self, action=None):
def log(message, level="info"):
with self.pool.cursor() as cr:
cr.execute("""
INSERT INTO ir_logging(create_date, create_uid, logging_type, dbname, name, level, message, path, line, func)
INSERT INTO ir_logging(create_date, create_uid, type, dbname, name, level, message, path, line, func)
VALUES (NOW() at time zone 'UTC', %s, %s, %s, %s, %s, %s, %s, %s, %s)
""", (self.env.uid, 'server', self._cr.dbname, __name__, level, message, "action", action.id, action.name))
@@ -10,7 +10,7 @@ class IrLogging(models.Model):
create_date = fields.Datetime(readonly=True)
create_uid = fields.Integer(string='Uid', readonly=True) # Integer not m2o is intentionnal
name = fields.Char(required=True)
logging_type = fields.Selection([('client', 'Client'), ('server', 'Server')], string='Type', required=True, index=True, oldname='type')
type = fields.Selection([('client', 'Client'), ('server', 'Server')], required=True, index=True)
dbname = fields.Char(string='Database Name', index=True)
level = fields.Char(index=True)
message = fields.Text(required=True)
@@ -7,7 +7,7 @@
<group>
<field name="create_date" />
<field name="dbname" />
<field name="logging_type" />
<field name="type" />
<field name="name" />
<field name="level" />
<field name="path" />
@@ -25,7 +25,7 @@
<field name="create_date" />
<field name="create_uid" />
<field name="dbname" />
<field name="logging_type" />
<field name="type" />
<field name="name" />
<field name="level" />
<field name="path" />
@@ -39,14 +39,14 @@
<field name="arch" type="xml">
<search string="Logs">
<field name="dbname" />
<field name="logging_type" />
<field name="type" />
<field name="name" />
<field name="level" />
<field name="message" />
<group expand="0" string="Group By">
<filter string="Database" name="database" domain="[]" context="{'group_by': 'dbname'}" />
<filter string="Level" name="group_by_level" domain="[]" context="{'group_by': 'level'}" />
<filter string="Type" name="group_by_type" domain="[]" context="{'group_by': 'logging_type'}" />
<filter string="Type" name="group_by_type" domain="[]" context="{'group_by': 'type'}" />
<filter string="Creation Date" name="group_by_month" domain="[]" context="{'group_by': 'create_date'}" />
</group>
</search>
View
@@ -51,7 +51,7 @@ def emit(self, record):
val = ('server', ct_db, record.name, levelname, msg, record.pathname[len(path_prefix)+1:], record.lineno, record.funcName)
cr.execute("""
INSERT INTO ir_logging(create_date, logging_type, dbname, name, level, message, path, line, func)
INSERT INTO ir_logging(create_date, type, dbname, name, level, message, path, line, func)
VALUES (NOW() at time zone 'UTC', %s, %s, %s, %s, %s, %s, %s, %s)
""", val)

0 comments on commit e9e8648

Please sign in to comment.