Remove all ocurrences of SPANK from our user facing errors.

This has been bugging me for some time but now we are triggering new errors internally
this is appearing to end users for problems they did not cause.

Additionally I was able to improve a couple of the errors by copying the
explanation from code comments into the error message.

Shorter error logs now too :)
This commit is contained in:
Andy Williams 2017-12-22 11:18:46 +00:00
parent 77dd065c52
commit 9a4eedb078
6 changed files with 12 additions and 40 deletions

View File

@ -801,9 +801,7 @@ _ecore_magic_fail(const void *d,
" Supplied: %08x - %s", " Supplied: %08x - %s",
(unsigned int)req_m, _ecore_magic_string_get(req_m), (unsigned int)req_m, _ecore_magic_string_get(req_m),
(unsigned int)m, _ecore_magic_string_get(m)); (unsigned int)m, _ecore_magic_string_get(m));
ERR("*** NAUGHTY PROGRAMMER!!!\n"
"*** SPANK SPANK SPANK!!!\n"
"*** Now go fix your code. Tut tut tut!");
if (getenv("ECORE_ERROR_ABORT")) abort(); if (getenv("ECORE_ERROR_ABORT")) abort();
} }

View File

@ -180,9 +180,7 @@ _ecore_exe_check_errno(int result,
case EPERM: case EPERM:
case EBUSY: case EBUSY:
{ /* Programmer fucked up. */ { /* Programmer fucked up. */
ERR("*** NAUGHTY PROGRAMMER!!!\n" ERR("*** Race condition between open() and dup() created in %s @%u.",
"*** SPANK SPANK SPANK!!!\n"
"*** Now go fix your code in %s @%u. Tut tut tut!",
file, line); file, line);
result = 0; result = 0;
break; break;
@ -190,10 +188,7 @@ _ecore_exe_check_errno(int result,
default: default:
{ /* Unsupported errno code, please add this one. */ { /* Unsupported errno code, please add this one. */
ERR("*** NAUGHTY PROGRAMMER!!!\n" ERR("*** Unsupported errno code %d, found in %s @%u, from %s @%u.",
"*** SPANK SPANK SPANK!!!\n"
"*** Unsupported errno code %d, please add this one.\n"
"*** Now go fix your code in %s @%u, from %s @%u. Tut tut tut!",
saved_errno, __FILE__, __LINE__, file, line); saved_errno, __FILE__, __LINE__, file, line);
result = 0; result = 0;
break; break;

View File

@ -1072,7 +1072,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
break; break;
case EDJE_PART_TYPE_GRADIENT: case EDJE_PART_TYPE_GRADIENT:
ERR("SPANK ! SPANK ! SPANK ! YOU ARE USING GRADIENT IN PART %s FROM GROUP %s INSIDE FILE %s !! THEY ARE NOW REMOVED !", ERR("YOU ARE USING GRADIENT IN PART %s FROM GROUP %s INSIDE FILE %s !! THEY ARE NOW REMOVED !",
ep->name, group, eina_file_filename_get(file)); ep->name, group, eina_file_filename_get(file));
break; break;

View File

@ -122,7 +122,7 @@ _edje_emit_child(Edje *ed, Edje_Real_Part *rp, const char *part, const char *sig
break; break;
default: default:
// ERR("SPANK SPANK SPANK !!!\nYou should never be here !"); // ERR("Unknown part type. You should never be here!");
break; break;
} }
return ed->collection->broadcast_signal; return ed->collection->broadcast_signal;

View File

@ -273,32 +273,23 @@ eina_magic_fail(void *d,
eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_ERR, eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_ERR,
file, fnc, line, file, fnc, line,
"*** Eina Magic Check Failed !!!\n" "*** Eina Magic Check Failed !!!\n"
" Input handle pointer is NULL !\n" " Input handle pointer is NULL.\n"
"*** NAUGHTY PROGRAMMER!!!\n"
"*** SPANK SPANK SPANK!!!\n"
"*** Now go fix your code. Tut tut tut!\n"
"\n"); "\n");
else else
if (m == EINA_MAGIC_NONE) if (m == EINA_MAGIC_NONE)
eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_CRITICAL, eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_CRITICAL,
file, fnc, line, file, fnc, line,
"*** Eina Magic Check Failed at %p !!!\n" "*** Eina Magic Check Failed at %p !!!\n"
" Input handle has already been freed!\n" " Input handle has already been freed.\n"
"*** NAUGHTY PROGRAMMER!!!\n"
"*** SPANK SPANK SPANK!!!\n"
"*** Now go fix your code. Tut tut tut!\n"
"\n", d); "\n", d);
else else
if (m != req_m) if (m != req_m)
eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_CRITICAL, eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_CRITICAL,
file, fnc, line, file, fnc, line,
"*** Eina Magic Check Failed at %p !!!\n" "*** Eina Magic Check Failed at %p !!!\n"
" Input handle is wrong type\n" " Input handle is wrong type.\n"
" Expected: %08x - %s\n" " Expected: %08x - %s\n"
" Supplied: %08x - %s\n" " Supplied: %08x - %s\n"
"*** NAUGHTY PROGRAMMER!!!\n"
"*** SPANK SPANK SPANK!!!\n"
"*** Now go fix your code. Tut tut tut!\n"
"\n", "\n",
d, req_m, eina_magic_string_get(req_m), d, req_m, eina_magic_string_get(req_m),
m, eina_magic_string_get(m)); m, eina_magic_string_get(m));
@ -306,10 +297,7 @@ eina_magic_fail(void *d,
eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_CRITICAL, eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_CRITICAL,
file, fnc, line, file, fnc, line,
"*** Eina Magic Check Failed !!!\n" "*** Eina Magic Check Failed !!!\n"
" Why did you call me !\n" " Unknown reason.\n"
"*** NAUGHTY PROGRAMMER!!!\n"
"*** SPANK SPANK SPANK!!!\n"
"*** Now go fix your code. Tut tut tut!\n"
"\n"); "\n");
} }

View File

@ -148,10 +148,7 @@ START_TEST(eina_magic_simple)
#endif #endif
TEST_MAGIC_SAFETY(__FUNCTION__, TEST_MAGIC_SAFETY(__FUNCTION__,
"*** Eina Magic Check Failed !!!\n" "*** Eina Magic Check Failed !!!\n"
" Input handle pointer is NULL !\n" " Input handle pointer is NULL.\n"
"*** NAUGHTY PROGRAMMER!!!\n"
"*** SPANK SPANK SPANK!!!\n"
"*** Now go fix your code. Tut tut tut!\n"
"\n"); "\n");
EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST); EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST);
fail_unless(ctx.did); fail_unless(ctx.did);
@ -169,10 +166,7 @@ START_TEST(eina_magic_simple)
#endif #endif
TEST_MAGIC_SAFETY(__FUNCTION__, TEST_MAGIC_SAFETY(__FUNCTION__,
"*** Eina Magic Check Failed at %p !!!\n" "*** Eina Magic Check Failed at %p !!!\n"
" Input handle has already been freed!\n" " Input handle has already been freed.\n"
"*** NAUGHTY PROGRAMMER!!!\n"
"*** SPANK SPANK SPANK!!!\n"
"*** Now go fix your code. Tut tut tut!\n"
"\n"); "\n");
ctx.expected_level = EINA_LOG_LEVEL_CRITICAL; ctx.expected_level = EINA_LOG_LEVEL_CRITICAL;
EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST); EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST);
@ -184,12 +178,9 @@ START_TEST(eina_magic_simple)
#endif #endif
TEST_MAGIC_SAFETY(__FUNCTION__, TEST_MAGIC_SAFETY(__FUNCTION__,
"*** Eina Magic Check Failed at %p !!!\n" "*** Eina Magic Check Failed at %p !!!\n"
" Input handle is wrong type\n" " Input handle is wrong type.\n"
" Expected: %08x - %s\n" " Expected: %08x - %s\n"
" Supplied: %08x - %s\n" " Supplied: %08x - %s\n"
"*** NAUGHTY PROGRAMMER!!!\n"
"*** SPANK SPANK SPANK!!!\n"
"*** Now go fix your code. Tut tut tut!\n"
"\n"); "\n");
ctx.expected_level = EINA_LOG_LEVEL_CRITICAL; ctx.expected_level = EINA_LOG_LEVEL_CRITICAL;
EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST); EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST);