[DEV] update Cmake and ROS log
This commit is contained in:
parent
cf7a98f8a4
commit
51bc7746e4
@ -54,7 +54,7 @@ add_library(${PROJECT_NAME}
|
|||||||
../${PROJECT_NAME}/archive/Zip.cpp
|
../${PROJECT_NAME}/archive/Zip.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "-std=c++11 -DDEBUG_LEVEL=3 -DDEBUG=1 -D__CPP_VERSION__=2011 -D__TARGET_OS__Linux")
|
set(CMAKE_CXX_FLAGS "-std=c++11 -DDEBUG_LEVEL=3 -DDEBUG=1 -D__CPP_VERSION__=2011 -D__TARGET_OS__Linux -DETK_EXTERN_FRAMEWORK_ROS")
|
||||||
|
|
||||||
|
|
||||||
## Add cmake target dependencies of the executable/library
|
## Add cmake target dependencies of the executable/library
|
||||||
|
33
etk/log.cpp
33
etk/log.cpp
@ -16,6 +16,9 @@
|
|||||||
#if defined(__TARGET_OS__Android)
|
#if defined(__TARGET_OS__Android)
|
||||||
# include <android/log.h>
|
# include <android/log.h>
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(ETK_EXTERN_FRAMEWORK_ROS)
|
||||||
|
#include <ros/ros.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <etk/logIOs.h>
|
#include <etk/logIOs.h>
|
||||||
|
|
||||||
@ -351,11 +354,13 @@ void etk::log::logChar(int32_t _id, int32_t _level, int32_t _ligne, const char*
|
|||||||
}
|
}
|
||||||
pointer = handle+strlen(handle);
|
pointer = handle+strlen(handle);
|
||||||
}
|
}
|
||||||
|
#if !defined(ETK_EXTERN_FRAMEWORK_ROS)
|
||||||
if(getTime() == true) {
|
if(getTime() == true) {
|
||||||
getDisplayTime(pointer);
|
getDisplayTime(pointer);
|
||||||
pointer = handle+strlen(handle);
|
pointer = handle+strlen(handle);
|
||||||
}
|
}
|
||||||
#if !defined(__TARGET_OS__Android)
|
#endif
|
||||||
|
#if !defined(__TARGET_OS__Android) && !defined(ETK_EXTERN_FRAMEWORK_ROS)
|
||||||
switch(_level) {
|
switch(_level) {
|
||||||
default:
|
default:
|
||||||
strcat(pointer, "[?] ");
|
strcat(pointer, "[?] ");
|
||||||
@ -459,6 +464,31 @@ void etk::log::logChar(int32_t _id, int32_t _level, int32_t _ligne, const char*
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_lock.lock();
|
g_lock.lock();
|
||||||
|
#if defined(ETK_EXTERN_FRAMEWORK_ROS)
|
||||||
|
switch(_level) {
|
||||||
|
default:
|
||||||
|
//ROS_VERBOSE_STREAM(handle);
|
||||||
|
break;
|
||||||
|
case logLevelCritical:
|
||||||
|
ROS_FATAL_STREAM(handle);
|
||||||
|
break;
|
||||||
|
case logLevelError:
|
||||||
|
ROS_ERROR_STREAM(handle);
|
||||||
|
break;
|
||||||
|
case logLevelWarning:
|
||||||
|
ROS_WARN_STREAM(handle);
|
||||||
|
break;
|
||||||
|
case logLevelInfo:
|
||||||
|
ROS_INFO_STREAM(handle);
|
||||||
|
break;
|
||||||
|
case logLevelDebug:
|
||||||
|
ROS_DEBUG_STREAM(handle);
|
||||||
|
break;
|
||||||
|
case logLevelVerbose:
|
||||||
|
//ROS_VERBOSE_STREAM(handle);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#else
|
||||||
#if defined(__TARGET_OS__Android)
|
#if defined(__TARGET_OS__Android)
|
||||||
// TODO : Set package name instead of ewol ...
|
// TODO : Set package name instead of ewol ...
|
||||||
switch(_level) {
|
switch(_level) {
|
||||||
@ -489,6 +519,7 @@ void etk::log::logChar(int32_t _id, int32_t _level, int32_t _ligne, const char*
|
|||||||
#else
|
#else
|
||||||
std::cout << handle << std::endl;
|
std::cout << handle << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
g_lock.unlock();
|
g_lock.unlock();
|
||||||
if (_level == logLevelCritical) {
|
if (_level == logLevelCritical) {
|
||||||
displayBacktrace(true, 2);
|
displayBacktrace(true, 2);
|
||||||
|
@ -420,19 +420,18 @@ std::string etk::getUserRunFolder() {
|
|||||||
|
|
||||||
|
|
||||||
#ifdef __TARGET_OS__Android
|
#ifdef __TARGET_OS__Android
|
||||||
bool etk::FSNode::loadDataZip()
|
bool etk::FSNode::loadDataZip() {
|
||||||
{
|
if (s_APKArchive == nullptr) {
|
||||||
if (NULL == s_APKArchive) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (NULL != m_zipContent) {
|
if (m_zipContent != nullptr) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (false == s_APKArchive->exist(m_systemFileName)) {
|
if (false == s_APKArchive->exist(m_systemFileName)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
m_zipContent = &s_APKArchive->getContent(m_systemFileName);
|
m_zipContent = &s_APKArchive->getContent(m_systemFileName);
|
||||||
if (NULL != m_zipContent) {
|
if (m_zipContent != nullptr) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -655,7 +654,7 @@ void etk::FSNode::privateSetName(const std::string& _newName) {
|
|||||||
}
|
}
|
||||||
m_type = etk::FSN_TYPE_RELATIF;
|
m_type = etk::FSN_TYPE_RELATIF;
|
||||||
} else if(start_with(destFilename, baseRunPath) == true) {
|
} else if(start_with(destFilename, baseRunPath) == true) {
|
||||||
TK_DBG_MODE(" ==> detect relatif 3");
|
TK_DBG_MODE(" ==> detect relatif 3 (run path=" << baseRunPath << ")");
|
||||||
destFilename.erase(0, baseRunPath.size());
|
destFilename.erase(0, baseRunPath.size());
|
||||||
while (destFilename.size()>0 && destFilename[0] == '/') {
|
while (destFilename.size()>0 && destFilename[0] == '/') {
|
||||||
destFilename.erase(0, 1);
|
destFilename.erase(0, 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user