forked from enlightenment/efl
eina_log: Update domain colouring when color_disable_set is called
After color_disable is set we should update the domain_str for each domain as this cached the setting from when the domain was registered. This required storing the colour within the domain for later use. Fixes T1029
This commit is contained in:
parent
47955c302a
commit
5913ce7ec8
1
NEWS
1
NEWS
|
@ -429,6 +429,7 @@ Fixes:
|
||||||
* textgrid - with new fallback fonts we cant depend on glyph extents anymore
|
* textgrid - with new fallback fonts we cant depend on glyph extents anymore
|
||||||
* textgrid - out-of-bounds chars cause update artifacts - fix.
|
* textgrid - out-of-bounds chars cause update artifacts - fix.
|
||||||
* Emotion test: fix calculation of the displayed time.
|
* Emotion test: fix calculation of the displayed time.
|
||||||
|
* eina: Update domain output if eina_log_color_disable_set is called after a domain is registered (T1029).
|
||||||
|
|
||||||
Removals:
|
Removals:
|
||||||
|
|
||||||
|
|
|
@ -920,6 +920,7 @@ eina_log_domain_new(Eina_Log_Domain *d, Eina_Log_Timing *t,
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
|
||||||
|
|
||||||
d->level = EINA_LOG_LEVEL_UNKNOWN;
|
d->level = EINA_LOG_LEVEL_UNKNOWN;
|
||||||
|
d->color = color;
|
||||||
d->deleted = EINA_FALSE;
|
d->deleted = EINA_FALSE;
|
||||||
|
|
||||||
if ((color) && (!_disable_color))
|
if ((color) && (!_disable_color))
|
||||||
|
@ -1581,7 +1582,24 @@ EAPI void
|
||||||
eina_log_color_disable_set(Eina_Bool disabled)
|
eina_log_color_disable_set(Eina_Bool disabled)
|
||||||
{
|
{
|
||||||
#ifdef EINA_ENABLE_LOG
|
#ifdef EINA_ENABLE_LOG
|
||||||
|
Eina_Log_Domain *domain;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
_disable_color = disabled;
|
_disable_color = disabled;
|
||||||
|
|
||||||
|
for (i = 0; i < _log_domains_count; i++)
|
||||||
|
{
|
||||||
|
domain = &_log_domains[i];
|
||||||
|
|
||||||
|
if (domain->domain_str)
|
||||||
|
free((char *)domain->domain_str);
|
||||||
|
|
||||||
|
if ((domain->color) && (!_disable_color))
|
||||||
|
domain->domain_str = eina_log_domain_str_get(domain->name, domain->color);
|
||||||
|
else
|
||||||
|
domain->domain_str = eina_log_domain_str_get(domain->name, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
(void) disabled;
|
(void) disabled;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -413,6 +413,7 @@ typedef struct _Eina_Log_Domain Eina_Log_Domain;
|
||||||
struct _Eina_Log_Domain
|
struct _Eina_Log_Domain
|
||||||
{
|
{
|
||||||
int level; /**< Max level to log */
|
int level; /**< Max level to log */
|
||||||
|
const char *color; /**< Color to use when printing in this domain */
|
||||||
const char *domain_str; /**< Formatted string with color to print */
|
const char *domain_str; /**< Formatted string with color to print */
|
||||||
const char *name; /**< Domain name */
|
const char *name; /**< Domain name */
|
||||||
size_t namelen; /**< strlen(name) */
|
size_t namelen; /**< strlen(name) */
|
||||||
|
|
Loading…
Reference in New Issue