eina log: print formatted string when log domain is invalid
authorJean-Philippe Andre <jp.andre@samsung.com>
Wed, 17 Feb 2016 06:40:43 +0000 (15:40 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Wed, 17 Feb 2016 07:12:35 +0000 (16:12 +0900)
commita4270b25a3f0866b4011e58d9857e7c4ce2bdd57
tree7fe9519188ce248151ad7807c03d9e02095fe04e
parentf649dac12ffc88d7c0b78cdeb4aff9f6338e1239
eina log: print formatted string when log domain is invalid

Before this patch, eina_log would simply record a non-formatted
entry like:
  unknown domain -1, original message format 'proxy=%p, obj=%p'

This was not very useful as even if the log domain is invalid, the
message itself might be relevant (often those are ERR logs).

Now the message format is roughly the same as the default format,
except that the line info comes from the original message (and
doesn't refer to eina_log.c).

Backtrace printing will happen at the same level as the original
log level, in order to avoid log pollution in case DBG logs are
printed with an invalid domain (and CRI would trigger bt).

I actually wonder if the logs shouldn't actually be forwarded
to the standard log callback instead of just stderr. This may
be useful for logging with dlog or journald (atm we will simply
lose all logs without a valid domain). This would mean eina_log
itself requires a log domain.
src/lib/eina/eina_log.c