forked from enlightenment/efl
improve logging messages introduced by Mathieu Taillefumier.
move some to error/critical, remove trailing \n. NOT doing ChangeLog entry on purpose, it's useless as it's an intra-release change (changes the previous unlreleased change) SVN revision: 42547
This commit is contained in:
parent
acc688873b
commit
183237e348
|
@ -70,7 +70,7 @@ struct _Eet_Node
|
||||||
} data;
|
} data;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* variable and macros used for the eina_log module
|
* variable and macros used for the eina_log module
|
||||||
*/
|
*/
|
||||||
extern int _eet_log_dom_global;
|
extern int _eet_log_dom_global;
|
||||||
|
@ -80,19 +80,19 @@ extern int _eet_log_dom_global;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the default module log domain is the eet log domain
|
* the default module log domain is the eet log domain
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define EET_DEFAULT_MODULE_LOG_DOMAIN _eet_log_dom_global
|
#define EET_DEFAULT_MODULE_LOG_DOMAIN _eet_log_dom_global
|
||||||
|
|
||||||
/* Macros that are used everywhere
|
/* Macros that are used everywhere
|
||||||
*
|
*
|
||||||
* the first four macros are the general macros for the lib
|
* the first four macros are the general macros for the lib
|
||||||
*/
|
*/
|
||||||
#ifdef EET_DEFAULT_LOG_COLOR
|
#ifdef EET_DEFAULT_LOG_COLOR
|
||||||
#undef EET_DEFAULT_LOG_COLOR
|
#undef EET_DEFAULT_LOG_COLOR
|
||||||
#endif
|
#endif
|
||||||
#define EET_DEFAULT_LOG_COLOR "\033[36m"
|
#define EET_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
|
||||||
#ifdef ERROR
|
#ifdef ERROR
|
||||||
#undef ERROR
|
#undef ERROR
|
||||||
#endif
|
#endif
|
||||||
|
@ -115,7 +115,7 @@ extern int _eet_log_dom_global;
|
||||||
#define CRITICAL(...) EINA_LOG_DOM_CRIT(_eet_log_dom_global, __VA_ARGS__)
|
#define CRITICAL(...) EINA_LOG_DOM_CRIT(_eet_log_dom_global, __VA_ARGS__)
|
||||||
/**
|
/**
|
||||||
* macros that are used all around the code for message processing
|
* macros that are used all around the code for message processing
|
||||||
* four macros are defined ERR, WRN, DGB, INF.
|
* four macros are defined ERR, WRN, DGB, INF.
|
||||||
* EFREET_MODULE_LOG_DOM should be defined individually for each module
|
* EFREET_MODULE_LOG_DOM should be defined individually for each module
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -272,7 +272,7 @@ eet_identity_print(Eet_Key *key, FILE *out)
|
||||||
goto on_error;
|
goto on_error;
|
||||||
if (!(res = malloc(size))) goto on_error;
|
if (!(res = malloc(size))) goto on_error;
|
||||||
|
|
||||||
INF("Private Key:\n");
|
INF("Private Key:");
|
||||||
buf[32] = '\0';
|
buf[32] = '\0';
|
||||||
|
|
||||||
for (i = 0; i < 6; i++)
|
for (i = 0; i < 6; i++)
|
||||||
|
@ -284,11 +284,11 @@ eet_identity_print(Eet_Key *key, FILE *out)
|
||||||
}
|
}
|
||||||
if (err) goto on_error;
|
if (err) goto on_error;
|
||||||
|
|
||||||
INF("\t%s:\n", names[i]);
|
INF("\t%s:", names[i]);
|
||||||
for (j = 0; strlen(res) > j; j += 32)
|
for (j = 0; strlen(res) > j; j += 32)
|
||||||
{
|
{
|
||||||
snprintf(buf, 32, "%s", res + j);
|
snprintf(buf, 32, "%s", res + j);
|
||||||
INF("\t\t%s\n", buf);
|
INF("\t\t%s", buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(res);
|
free(res);
|
||||||
|
@ -297,7 +297,7 @@ eet_identity_print(Eet_Key *key, FILE *out)
|
||||||
|
|
||||||
if (key->certificate)
|
if (key->certificate)
|
||||||
{
|
{
|
||||||
INF("Public certificate:\n");
|
INF("Public certificate:");
|
||||||
if (gnutls_x509_crt_print(key->certificate, GNUTLS_X509_CRT_FULL, &data)) goto on_error;
|
if (gnutls_x509_crt_print(key->certificate, GNUTLS_X509_CRT_FULL, &data)) goto on_error;
|
||||||
INF("%s", data.data);
|
INF("%s", data.data);
|
||||||
gnutls_free(data.data);
|
gnutls_free(data.data);
|
||||||
|
@ -318,29 +318,29 @@ eet_identity_print(Eet_Key *key, FILE *out)
|
||||||
rsa = EVP_PKEY_get1_RSA(key->private_key);
|
rsa = EVP_PKEY_get1_RSA(key->private_key);
|
||||||
if (rsa)
|
if (rsa)
|
||||||
{
|
{
|
||||||
INF("Private key (RSA):\n");
|
INF("Private key (RSA):");
|
||||||
RSA_print_fp(out, rsa, 0);
|
RSA_print_fp(out, rsa, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
dsa = EVP_PKEY_get1_DSA(key->private_key);
|
dsa = EVP_PKEY_get1_DSA(key->private_key);
|
||||||
if (dsa)
|
if (dsa)
|
||||||
{
|
{
|
||||||
INF("Private key (DSA):\n");
|
INF("Private key (DSA):");
|
||||||
DSA_print_fp(out, dsa, 0);
|
DSA_print_fp(out, dsa, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
dh = EVP_PKEY_get1_DH(key->private_key);
|
dh = EVP_PKEY_get1_DH(key->private_key);
|
||||||
if (dh)
|
if (dh)
|
||||||
{
|
{
|
||||||
INF("Private key (DH):\n");
|
INF("Private key (DH):");
|
||||||
DHparams_print_fp(out, dh);
|
DHparams_print_fp(out, dh);
|
||||||
}
|
}
|
||||||
|
|
||||||
INF("Public certificate:\n");
|
INF("Public certificate:");
|
||||||
X509_print_fp(out, key->certificate);
|
X509_print_fp(out, key->certificate);
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
INF("You need to compile signature support in EET.\n");
|
ERROR("You need to compile signature support in EET.");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -682,7 +682,7 @@ eet_identity_certificate_print(const unsigned char *certificate, int der_length,
|
||||||
#ifdef HAVE_SIGNATURE
|
#ifdef HAVE_SIGNATURE
|
||||||
if (!certificate || !out || der_length <= 0)
|
if (!certificate || !out || der_length <= 0)
|
||||||
{
|
{
|
||||||
INFO("No certificate provided.\n");
|
ERROR("No certificate provided.");
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
# ifdef HAVE_GNUTLS
|
# ifdef HAVE_GNUTLS
|
||||||
|
@ -699,7 +699,7 @@ eet_identity_certificate_print(const unsigned char *certificate, int der_length,
|
||||||
datum.data = NULL;
|
datum.data = NULL;
|
||||||
datum.size = 0;
|
datum.size = 0;
|
||||||
if (gnutls_x509_crt_print(cert, GNUTLS_X509_CRT_FULL, &datum)) goto on_error;
|
if (gnutls_x509_crt_print(cert, GNUTLS_X509_CRT_FULL, &datum)) goto on_error;
|
||||||
INF("Public certificate :\n");
|
INF("Public certificate :");
|
||||||
INF("%s", datum.data);
|
INF("%s", datum.data);
|
||||||
|
|
||||||
on_error:
|
on_error:
|
||||||
|
@ -715,17 +715,17 @@ eet_identity_certificate_print(const unsigned char *certificate, int der_length,
|
||||||
x509 = d2i_X509(NULL, &tmp, der_length);
|
x509 = d2i_X509(NULL, &tmp, der_length);
|
||||||
if (x509 == NULL)
|
if (x509 == NULL)
|
||||||
{
|
{
|
||||||
INF("Not a valid certificate.\n");
|
INF("Not a valid certificate.");
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
INF("Public certificate :\n");
|
INF("Public certificate :");
|
||||||
X509_print_fp(out, x509);
|
X509_print_fp(out, x509);
|
||||||
|
|
||||||
X509_free(x509);
|
X509_free(x509);
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
INF("You need to compile signature support in EET.\n");
|
ERROR("You need to compile signature support in EET.");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1994,7 +1994,7 @@ _eet_data_dump_parse(Eet_Dictionary *ed,
|
||||||
else if (!strcmp(tok3, "hash")) n->type = EET_G_HASH;
|
else if (!strcmp(tok3, "hash")) n->type = EET_G_HASH;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERR("ERROR: group type '%s' invalid.\n", tok3);
|
ERR("ERROR: group type '%s' invalid.", tok3);
|
||||||
}
|
}
|
||||||
node = n;
|
node = n;
|
||||||
}
|
}
|
||||||
|
@ -2106,7 +2106,7 @@ _eet_data_dump_parse(Eet_Dictionary *ed,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERR("ERROR: value type '%s' invalid.\n", tok4);
|
ERR("ERROR: value type '%s' invalid.", tok4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,6 @@ struct _Eet_File_Node
|
||||||
unsigned char ciphered : 1;
|
unsigned char ciphered : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* Version 2 */
|
/* Version 2 */
|
||||||
/* NB: all int's are stored in network byte order on disk */
|
/* NB: all int's are stored in network byte order on disk */
|
||||||
|
@ -319,7 +318,7 @@ eet_cache_add(Eet_File *ef, Eet_File ***cache, int *cache_num, int *cache_alloc)
|
||||||
new_cache = realloc(new_cache, new_cache_alloc * sizeof(Eet_File *));
|
new_cache = realloc(new_cache, new_cache_alloc * sizeof(Eet_File *));
|
||||||
if (!new_cache)
|
if (!new_cache)
|
||||||
{
|
{
|
||||||
CRITICAL("BAD ERROR! Eet realloc of cache list failed. Abort\n");
|
CRITICAL("BAD ERROR! Eet realloc of cache list failed. Abort");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -364,7 +363,7 @@ eet_cache_del(Eet_File *ef, Eet_File ***cache, int *cache_num, int *cache_alloc)
|
||||||
new_cache = realloc(new_cache, new_cache_alloc * sizeof(Eet_File *));
|
new_cache = realloc(new_cache, new_cache_alloc * sizeof(Eet_File *));
|
||||||
if (!new_cache)
|
if (!new_cache)
|
||||||
{
|
{
|
||||||
CRITICAL("BAD ERROR! Eet realloc of cache list failed. Abort\n");
|
CRITICAL("BAD ERROR! Eet realloc of cache list failed. Abort");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -768,7 +767,7 @@ eet_init(void)
|
||||||
_eet_log_dom_global = eina_log_domain_register("Eet",EET_DEFAULT_LOG_COLOR);
|
_eet_log_dom_global = eina_log_domain_register("Eet",EET_DEFAULT_LOG_COLOR);
|
||||||
if(_eet_log_dom_global < 0)
|
if(_eet_log_dom_global < 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr,"Eet Can not create a general log domain");
|
EINA_LOG_ERR("Eet Can not create a general log domain.");
|
||||||
goto error_eet_eina_log;
|
goto error_eet_eina_log;
|
||||||
}
|
}
|
||||||
return eet_initcount;
|
return eet_initcount;
|
||||||
|
@ -794,6 +793,7 @@ eet_shutdown(void)
|
||||||
|
|
||||||
eet_clearcache();
|
eet_clearcache();
|
||||||
eina_log_domain_unregister(_eet_log_dom_global);
|
eina_log_domain_unregister(_eet_log_dom_global);
|
||||||
|
_eet_log_dom_global = -1;
|
||||||
eina_shutdown();
|
eina_shutdown();
|
||||||
#ifdef HAVE_GNUTLS
|
#ifdef HAVE_GNUTLS
|
||||||
gnutls_global_deinit();
|
gnutls_global_deinit();
|
||||||
|
@ -1074,7 +1074,7 @@ eet_internal_read2(Eet_File *ef)
|
||||||
|
|
||||||
if (eet_test_close(ef->x509_der == NULL, ef)) return NULL;
|
if (eet_test_close(ef->x509_der == NULL, ef)) return NULL;
|
||||||
#else
|
#else
|
||||||
ERROR("This file could be signed but you didn't compile the necessary code to check the signature.\n");
|
ERROR("This file could be signed but you didn't compile the necessary code to check the signature.");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1092,7 +1092,7 @@ eet_internal_read1(Eet_File *ef)
|
||||||
int byte_entries;
|
int byte_entries;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
WARN("EET file format of '%s' is deprecated. You should just open it one time with mode == EET_FILE_MODE_READ_WRITE to solve this issue.\n", ef->path);
|
WARN("EET file format of '%s' is deprecated. You should just open it one time with mode == EET_FILE_MODE_READ_WRITE to solve this issue.", ef->path);
|
||||||
|
|
||||||
/* build header table if read mode */
|
/* build header table if read mode */
|
||||||
/* geat header */
|
/* geat header */
|
||||||
|
@ -1219,7 +1219,7 @@ eet_internal_read1(Eet_File *ef)
|
||||||
strncpy(efn->name, (char *)p + HEADER_SIZE, name_size);
|
strncpy(efn->name, (char *)p + HEADER_SIZE, name_size);
|
||||||
efn->name[name_size] = 0;
|
efn->name[name_size] = 0;
|
||||||
|
|
||||||
WARN("File: %s is not up to date for key \"%s\" - needs rebuilding sometime\n", ef->path, efn->name);
|
WARN("File: %s is not up to date for key \"%s\" - needs rebuilding sometime", ef->path, efn->name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
/* The only really usefull peace of code for efn->name (no backward compatibility) */
|
/* The only really usefull peace of code for efn->name (no backward compatibility) */
|
||||||
|
|
Loading…
Reference in New Issue