void initializeLoggingChannelsIfNecessary() { static bool didInitializeLoggingChannels = false; if (didInitializeLoggingChannels) return; didInitializeLoggingChannels = true; char* logEnv = getenv("WEBKIT_DEBUG"); if (!logEnv) return; #if defined(NDEBUG) EINA_LOG_WARN("WEBKIT_DEBUG is not empty, but this is a release build. Notice that many log messages will only appear in a debug build."); #endif char** logv = eina_str_split(logEnv, ",", -1); EINA_SAFETY_ON_NULL_RETURN(logv); for (int i = 0; logv[i]; i++) { if (WTFLogChannel* channel = getChannelFromName(logv[i])) channel->state = WTFLogChannelOn; } free(*logv); free(logv); // To disable logging notImplemented set the DISABLE_NI_WARNING // environment variable to 1. LogNotYetImplemented.state = WTFLogChannelOn; }
bool PluginPackage::load() { char* errmsg; if (m_isLoaded) { m_loadCount++; return true; } m_module = dlopen(m_path.utf8().data(), RTLD_LAZY | RTLD_LOCAL); if ((errmsg = dlerror())) { EINA_LOG_WARN("%s not loaded: %s", m_path.utf8().data(), errmsg); return false; } m_isLoaded = true; NP_InitializeFuncPtr initialize; NPError err; initialize = reinterpret_cast<NP_InitializeFuncPtr>(dlsym(m_module, "NP_Initialize")); if ((errmsg = dlerror())) { EINA_LOG_ERR("Could not get symbol NP_Initialize: %s", errmsg); goto abort; } m_NPP_Shutdown = reinterpret_cast<NPP_ShutdownProcPtr>(dlsym(m_module, "NP_Shutdown")); if ((errmsg = dlerror())) { EINA_LOG_ERR("Could not get symbol NP_Shutdown: %s", errmsg); goto abort; } memset(&m_pluginFuncs, 0, sizeof(m_pluginFuncs)); m_pluginFuncs.size = sizeof(m_pluginFuncs); initializeBrowserFuncs(); #if defined(XP_UNIX) err = initialize(&m_browserFuncs, &m_pluginFuncs); #else err = initialize(&m_browserFuncs); #endif if (err != NPERR_NO_ERROR) goto abort; m_loadCount++; return true; abort: EINA_LOG_DBG("failed to load plugin, unload it without shutting it down."); unloadWithoutShutdown(); return false; }
static Evas_Object *create_my_group(Evas *canvas, const char *text) { Evas_Object *edje; edje = edje_object_add(canvas); if (!edje) { EINA_LOG_CRIT("could not create edje object!"); return NULL; } if (!edje_object_file_set(edje, PACKAGE_DATA_DIR"/edje_example.edj", "my_group")) { int err = edje_object_load_error_get(edje); const char *errmsg = edje_load_error_str(err); EINA_LOG_ERR("could not load 'my_group' from edje_example.edj: %s", errmsg); evas_object_del(edje); return NULL; } if (text) { if (!edje_object_part_text_set(edje, "text", text)) { EINA_LOG_WARN("could not set the text. " "Maybe part 'text' does not exist?"); } } evas_object_move(edje, 0, 0); evas_object_resize(edje, WIDTH, HEIGHT); evas_object_show(edje); return edje; }
static void _warning(void *user_data, const char *msg, ...) { EINA_LOG_WARN("%s", msg); }