void Logger::init() {
std::vector<std::shared_ptr<AbstractLogger> >::iterator it =
m_loggers.begin(), end = m_loggers.end();
- for (; it != end; ++it) {
- (*it)->init();
+ int count = std::distance(it, end);
+ if (count > 0) {
+ if ((*it) != nullptr) {
+ for (; it != end; ++it) {
+ (*it)->init();
+ }
+ }
+ } else {
+ return;
}
}
LoggerLevel ) {
std::vector<std::shared_ptr<AbstractLogger> >::iterator it =
m_loggers.begin(), end = m_loggers.end();
- for (; it != end; ++it) {
- (*it)->log(timeStamp(), m_tag, msg, errorFlag);
+ int count = std::distance(it, end);
+ if (count > 0) {
+ if ((*it) != nullptr) {
+ for (; it != end; ++it) {
+ (*it)->log(timeStamp(), m_tag, msg, errorFlag);
+ }
+ }
+ } else {
+ return;
}
}
}
std::string Logger::timeStamp() {
- time_t initializer = time(NULL);
struct tm b;
- if(localtime_r(&initializer,&b)==NULL){
- return std::string("");
- }
-
struct timeval detail_time;
- gettimeofday(&detail_time,NULL);
+ gettimeofday(&detail_time, NULL);
char buf[80];
// strftime(buf, sizeof(buf), "%d/%m/%y,%T ", brokenTime, detail_time.tv_usec/1000);
- snprintf(buf, sizeof(buf),"[%d/%d/%d,%d:%d:%d.%ld]", b.tm_year, b.tm_mon, b.tm_mday, b.tm_hour, b.tm_min, b.tm_sec, detail_time.tv_usec/1000);
+ snprintf(buf, sizeof(buf), "[%d/%d/%d,%d:%d:%d.%ld]", b.tm_year, b.tm_mon, b.tm_mday, b.tm_hour, b.tm_min, b.tm_sec, detail_time.tv_usec/1000);
return std::string(buf);
}
{
Elm_Entry_Filter_Limit_Size* limitFilterData =
static_cast<Elm_Entry_Filter_Limit_Size*>(calloc(1, sizeof(Elm_Entry_Filter_Limit_Size)));
- limitFilterData->max_char_count = boost::any_cast<int>(config::Config::getInstance().get(
- standard_entry ? "ENTRY_MAXCHAR" : "URL_MAXCHAR"));
- limitFilterData->max_byte_count = 0;
+ if (limitFilterData) {
+ limitFilterData->max_char_count = boost::any_cast<int>(config::Config::getInstance().get(
+ standard_entry ? "ENTRY_MAXCHAR" : "URL_MAXCHAR"));
+ limitFilterData->max_byte_count = 0;
- elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, limitFilterData);
-
- evas_object_smart_callback_add(entry, "maxlength,reached", _entry_maxlength_reached, limitFilterData);
+ elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, limitFilterData);
+ evas_object_smart_callback_add(entry, "maxlength,reached", _entry_maxlength_reached, limitFilterData);
+ }
return limitFilterData;
}
/* to test this functionality please use aul_test command on target:
* $aul_test org.tizen.browser __APP_SVC_URI__ <http://full.url.com/>
*/
- BROWSER_LOGD("%s app_control_h=%p\n", __func__,app_control);
+ BROWSER_LOGD("%s app_control_h=%p\n", __func__, app_control);
char *operation = NULL;
char *request_uri = NULL;
char *instance_id = NULL;
char *push_data = NULL;
- if (app_control_get_operation(app_control, &operation) != APP_CONTROL_ERROR_NONE) {
- BROWSER_LOGD("get app_control operation failed");
- return;
- }
-
- if (app_control_get_uri(app_control, &request_uri) != APP_CONTROL_ERROR_NONE)
- BROWSER_LOGD("get app_control uri failed");
-
- if (app_control_get_mime(app_control, &request_mime_type) != APP_CONTROL_ERROR_NONE)
- BROWSER_LOGD("get app_control mime failed");
-
- if (app_control_get_caller(app_control, &request_caller) != APP_CONTROL_ERROR_NONE)
- BROWSER_LOGD("get app_control caller failed");
+ app_control_get_operation(app_control, &operation);
+ app_control_get_uri(app_control, &request_uri);
+ app_control_get_mime(app_control, &request_mime_type);
+ app_control_get_caller(app_control, &request_caller);
BROWSER_LOGD("operation = [%s], request_uri = [%s], request_caller = [%s] request_mime_type = [%s]"
, operation, request_uri, request_caller, request_mime_type);
std::string inst_id;
std::string pushData;
- if((operation && !strcmp(operation, APP_CONTROL_OPERATION_VIEW)) && (request_uri != NULL)) {
+ if ((operation && !strcmp(operation, APP_CONTROL_OPERATION_VIEW)) && (request_uri != NULL)) {
if (request_uri) {
if (!strncmp(request_uri, "/opt/", strlen("/opt/"))) {
uri = std::string("file://") + uri;
}
}
- if (app_control_get_extra_data(app_control, "search", &search_keyword) == APP_CONTROL_ERROR_NONE) {
- BROWSER_LOGD("search keyword launching");
+ app_control_get_extra_data(app_control, "search", &search_keyword);
+ app_control_get_instance_id(app_control, &instance_id);
+ app_control_get_extra_data(app_control, "push_data", &push_data);
- if (search_keyword) {
- uri=std::string(search_keyword);
- free(search_keyword);
- }
+ if (search_keyword) {
+ uri = std::string(search_keyword);
+ free(search_keyword);
}
- if (app_control_get_instance_id(app_control, &instance_id) == APP_CONTROL_ERROR_NONE) {
- BROWSER_LOGD("get instance id %s", instance_id);
- if (instance_id) {
- inst_id=std::string(instance_id);
- free(instance_id);
- }
+ if (instance_id) {
+ inst_id = std::string(instance_id);
+ free(instance_id);
}
- if (app_control_get_extra_data(app_control, "push_data", &push_data) == APP_CONTROL_ERROR_NONE) {
- BROWSER_LOGD("get push data %s", push_data);
- if (push_data) {
- pushData=std::string(push_data);
- free(push_data);
- }
+ if (push_data) {
+ pushData = std::string(push_data);
+ free(push_data);
}
if ((operation && !strcmp(operation, APP_CONTROL_OPERATION_SEARCH )) &&
((app_control_get_extra_data(app_control, "http://tizen.org/appcontrol/data/keyword", &search_keyword) == APP_CONTROL_ERROR_NONE) ||
(app_control_get_extra_data(app_control, APP_CONTROL_DATA_TEXT, &search_keyword) == APP_CONTROL_ERROR_NONE))) {
- BROWSER_LOGD("APP_CONTROL_OPERATION_SEARCH");
if (search_keyword) {
- uri=std::string(search_keyword);
+ uri = std::string(search_keyword);
free(search_keyword);
}
}
free(request_caller);
free(operation);
- if(inst_id.empty()) {
- inst_id="browser0";
+ if (inst_id.empty()) {
+ inst_id = "browser0";
}
- std::string pwa_id="--browser-instance-id="+inst_id;
- BROWSER_LOGD("+++Set Instance-ID=%s",pwa_id.c_str());
+ std::string pwa_id = "--browser-instance-id="+inst_id;
+ BROWSER_LOGD("+++Set Instance-ID=%s", pwa_id.c_str());
browser_argv.push_back(const_cast<char*>(pwa_id.c_str()));
ewk_set_arguments(browser_argv.size(), browser_argv.data());
evas_object_show((*bd)->getMainWindow().get());
elm_win_activate((*bd)->getMainWindow().get());
- if (appcore_flush_memory() == -1)
- BROWSER_LOGW("[%s] appcore_flush_memory error!", __PRETTY_FUNCTION__);
+ if (appcore_flush_memory() == -1) {
+ return;
+ }
}
static void app_pause(void* app_data){
//#endif
BROWSER_LOGD("BROWSER IS SAYING HELLO");
- BROWSER_LOGD("BROWSER TAG: %s",tizen_browser::logger::Logger::getInstance().getLogTag().c_str());
- BROWSER_LOGD("BROWSER REGISTERED LOGGERS COUNT: %d",tizen_browser::logger::Logger::getInstance().getLoggersCount());
+ BROWSER_LOGD("BROWSER TAG: %s", tizen_browser::logger::Logger::getInstance().getLogTag().c_str());
+ BROWSER_LOGD("BROWSER REGISTERED LOGGERS COUNT: %d", tizen_browser::logger::Logger::getInstance().getLoggersCount());
setenv("COREGL_FASTPATH", "1", 1);