improve logging messages introduced by Mathieu Taillefumier.
authorbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 17 Sep 2009 14:33:06 +0000 (14:33 +0000)
committerbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 17 Sep 2009 14:33:06 +0000 (14:33 +0000)
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)

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eet@42547 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/Eet_private.h
src/lib/eet_cipher.c
src/lib/eet_data.c
src/lib/eet_lib.c

index 9e8c09e..c71b612 100644 (file)
@@ -70,7 +70,7 @@ struct _Eet_Node
    } data;
 };
 
-/**  
+/**
  * variable and macros used for the eina_log module
  */
 extern int _eet_log_dom_global;
@@ -80,19 +80,19 @@ extern int _eet_log_dom_global;
 #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
 
-/* Macros that are used everywhere 
+/* Macros that are used everywhere
  *
  * the first four macros are the general macros for the lib
  */
 #ifdef EET_DEFAULT_LOG_COLOR
 #undef EET_DEFAULT_LOG_COLOR
 #endif
-#define EET_DEFAULT_LOG_COLOR "\033[36m"
+#define EET_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
 #ifdef ERROR
 #undef ERROR
 #endif
@@ -115,7 +115,7 @@ extern int _eet_log_dom_global;
 #define CRITICAL(...) EINA_LOG_DOM_CRIT(_eet_log_dom_global, __VA_ARGS__)
 /**
  * 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
  */
 
index eae971a..f6ccb18 100644 (file)
@@ -272,7 +272,7 @@ eet_identity_print(Eet_Key *key, FILE *out)
        goto on_error;
       if (!(res = malloc(size))) goto on_error;
 
-      INF("Private Key:\n");
+      INF("Private Key:");
       buf[32] = '\0';
 
       for (i = 0; i < 6; i++)
@@ -284,11 +284,11 @@ eet_identity_print(Eet_Key *key, FILE *out)
            }
          if (err) goto on_error;
 
-         INF("\t%s:\n", names[i]);
+         INF("\t%s:", names[i]);
          for (j = 0; strlen(res) > j; j += 32)
            {
              snprintf(buf, 32, "%s", res + j);
-             INF("\t\t%s\n", buf);
+             INF("\t\t%s", buf);
            }
        }
       free(res);
@@ -297,7 +297,7 @@ eet_identity_print(Eet_Key *key, FILE *out)
 
   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;
       INF("%s", 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);
   if (rsa)
     {
-      INF("Private key (RSA):\n");
+      INF("Private key (RSA):");
       RSA_print_fp(out, rsa, 0);
     }
 
   dsa = EVP_PKEY_get1_DSA(key->private_key);
   if (dsa)
     {
-      INF("Private key (DSA):\n");
+      INF("Private key (DSA):");
       DSA_print_fp(out, dsa, 0);
     }
 
   dh = EVP_PKEY_get1_DH(key->private_key);
   if (dh)
     {
-      INF("Private key (DH):\n");
+      INF("Private key (DH):");
       DHparams_print_fp(out, dh);
     }
 
-  INF("Public certificate:\n");
+  INF("Public certificate:");
   X509_print_fp(out, key->certificate);
 # endif
 #else
-  INF("You need to compile signature support in EET.\n");
+  ERROR("You need to compile signature support in EET.");
 #endif
 }
 
@@ -682,7 +682,7 @@ eet_identity_certificate_print(const unsigned char *certificate, int der_length,
 #ifdef HAVE_SIGNATURE
   if (!certificate || !out || der_length <= 0)
      {
-       INFO("No certificate provided.\n");
+       ERROR("No certificate provided.");
        return ;
      }
 # ifdef HAVE_GNUTLS
@@ -699,7 +699,7 @@ eet_identity_certificate_print(const unsigned char *certificate, int der_length,
   datum.data = NULL;
   datum.size = 0;
   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);
 
  on_error:
@@ -715,17 +715,17 @@ eet_identity_certificate_print(const unsigned char *certificate, int der_length,
    x509 = d2i_X509(NULL, &tmp, der_length);
    if (x509 == NULL)
      {
-       INF("Not a valid certificate.\n");
+       INF("Not a valid certificate.");
        return ;
      }
 
-   INF("Public certificate :\n");
+   INF("Public certificate :");
    X509_print_fp(out, x509);
 
    X509_free(x509);
 # endif
 #else
-   INF("You need to compile signature support in EET.\n");
+   ERROR("You need to compile signature support in EET.");
 #endif
 }
 
index 87b5786..3dbd9a7 100644 (file)
@@ -1994,7 +1994,7 @@ _eet_data_dump_parse(Eet_Dictionary *ed,
                                           else if (!strcmp(tok3, "hash"))      n->type = EET_G_HASH;
                                           else
                                             {
-                                              ERR("ERROR: group type '%s' invalid.\n", tok3);
+                                              ERR("ERROR: group type '%s' invalid.", tok3);
                                             }
                                           node = n;
                                        }
@@ -2106,7 +2106,7 @@ _eet_data_dump_parse(Eet_Dictionary *ed,
                                             }
                                           else
                                             {
-                                               ERR("ERROR: value type '%s' invalid.\n", tok4);
+                                               ERR("ERROR: value type '%s' invalid.", tok4);
                                             }
                                        }
                                   }
index 88e91ac..d9c47a4 100644 (file)
@@ -142,7 +142,6 @@ struct _Eet_File_Node
    unsigned char         ciphered : 1;
 };
 
-
 #if 0
 /* Version 2 */
 /* 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 *));
        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();
          }
      }
@@ -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 *));
             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();
               }
          }
@@ -768,7 +767,7 @@ eet_init(void)
    _eet_log_dom_global = eina_log_domain_register("Eet",EET_DEFAULT_LOG_COLOR);
    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;
      }
    return eet_initcount;
@@ -794,6 +793,7 @@ eet_shutdown(void)
 
    eet_clearcache();
    eina_log_domain_unregister(_eet_log_dom_global);
+   _eet_log_dom_global = -1;
    eina_shutdown();
 #ifdef HAVE_GNUTLS
    gnutls_global_deinit();
@@ -1074,7 +1074,7 @@ eet_internal_read2(Eet_File *ef)
 
        if (eet_test_close(ef->x509_der == NULL, ef)) return NULL;
 #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
      }
 
@@ -1092,7 +1092,7 @@ eet_internal_read1(Eet_File *ef)
    int                  byte_entries;
    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 */
    /* geat header */
@@ -1219,7 +1219,7 @@ eet_internal_read1(Eet_File *ef)
             strncpy(efn->name, (char *)p + HEADER_SIZE, name_size);
             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
          /* The only really usefull peace of code for efn->name (no backward compatibility) */