[DEV] continue remove stl
This commit is contained in:
parent
2bcb9068aa
commit
c3837bcc1b
@ -9,6 +9,7 @@
|
||||
#include <elog/log.hpp>
|
||||
#include <elog/elog.hpp>
|
||||
#include <elog/debug.hpp>
|
||||
#include <etk/String.hpp>
|
||||
|
||||
static elog::level getLogLevel(const etk::String& _value) {
|
||||
if (_value == "0") {
|
||||
@ -40,7 +41,7 @@ static bool startWith(const etk::String& _obj, const etk::String& _val) {
|
||||
for( size_t iii = 0;
|
||||
iii < _val.size();
|
||||
iii++) {
|
||||
if (std::tolower(_val[iii]) != std::tolower(_obj[iii])) {
|
||||
if (etk::toLower(_val[iii]) != etk::toLower(_obj[iii])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ int32_t elog::registerInstance(const etk::String& _name) {
|
||||
if (_name.size() >= getNameSizeLog()) {
|
||||
getNameSizeLog() = _name.size()+1;
|
||||
}
|
||||
//std::cout << "register log : '" << _name << "'=" << getList().size()-1 << std::endl;
|
||||
//printf("register log : '%s'=%ld\n", _name.c_str(), getList().size()-1);
|
||||
return getList().size()-1;
|
||||
}
|
||||
|
||||
@ -721,7 +721,7 @@ void elog::logChar(int32_t _id, int32_t _level, int32_t _ligne, const char* _fun
|
||||
#elif defined(__TARGET_OS__IOs)
|
||||
iosNSLog(handle);
|
||||
#else
|
||||
std::cout << handle << std::endl;
|
||||
printf("%s\n", handle);
|
||||
#endif
|
||||
g_lock.unlock();
|
||||
if (_level == level_critical) {
|
||||
|
@ -58,7 +58,7 @@ def configure(target, my_module):
|
||||
my_module.compile_version("c++", 2011)
|
||||
my_module.compile_version("c", 1999)
|
||||
# add dependency of the generic C++ library:
|
||||
my_module.add_depend('cxx')
|
||||
my_module.add_optionnal_depend('etk-base')
|
||||
my_module.add_optionnal_depend('ethread-tools', ["c++", "-DELOG_BUILD_ETHREAD"])
|
||||
|
||||
if "Windows" in target.get_type():
|
||||
|
@ -17,31 +17,31 @@ static void myExternalLogCallback(const char* _libName, enum elog::level _level,
|
||||
//! [elog_sample_main_callback_DECLARATION]
|
||||
switch(_level) {
|
||||
default:
|
||||
std::cout << "[?] ";
|
||||
printf("[?] ");
|
||||
break;
|
||||
case elog::level_print:
|
||||
std::cout << "[P] ";
|
||||
printf("[P] ");
|
||||
break;
|
||||
case elog::level_critical:
|
||||
std::cout << "[C] ";
|
||||
printf("[C] ");
|
||||
break;
|
||||
case elog::level_error:
|
||||
std::cout << "[E] ";
|
||||
printf("[E] ");
|
||||
break;
|
||||
case elog::level_warning:
|
||||
std::cout << "[W] ";
|
||||
printf("[W] ");
|
||||
break;
|
||||
case elog::level_info:
|
||||
std::cout << "[I] ";
|
||||
printf("[I] ");
|
||||
break;
|
||||
case elog::level_debug:
|
||||
std::cout << "[D] ";
|
||||
printf("[D] ");
|
||||
break;
|
||||
case elog::level_verbose:
|
||||
std::cout << "[V] ";
|
||||
printf("[V] ");
|
||||
break;
|
||||
}
|
||||
std::cout << _libName << " (" << _ligne << ") " << _funcName << " | " << _log << std::endl;
|
||||
printf("%s (%d) %s | %s\n", _libName, _ligne, _funcName, _log);
|
||||
}
|
||||
//! [elog_sample_main_callback]
|
||||
|
||||
@ -49,8 +49,10 @@ static void myExternalLogCallback(const char* _libName, enum elog::level _level,
|
||||
//! [elog_sample_main]
|
||||
/**
|
||||
* @brief Main of the program (This can be set in every case, but it is not used in Andoid...).
|
||||
* @param std IO
|
||||
* @return std IO
|
||||
* @param[in] _argc standard input argument count
|
||||
* @param[in] _argv standard input argument data (pointer on strings)
|
||||
* @return <0 an error occurred
|
||||
* @return all is good otherwise
|
||||
*/
|
||||
//! [elog_sample_main_base]
|
||||
int main(int _argc, const char *_argv[]) {
|
||||
@ -66,14 +68,12 @@ int main(int _argc, const char *_argv[]) {
|
||||
APPL_PRINT("PRINT display");
|
||||
//APPL_CRITICAL("CRITICAL display"); // Disable critical because it create an assert ...
|
||||
//! [elog_sample_main_log]
|
||||
|
||||
// Change the global log level:
|
||||
elog::setLevel(elog::level_verbose);
|
||||
//! [elog_sample_main_callback_link]
|
||||
// Set a callback:
|
||||
elog::setCallbackLog(&myExternalLogCallback);
|
||||
//! [elog_sample_main_callback_link]
|
||||
|
||||
// try again new logs:
|
||||
APPL_VERBOSE("VERBOSE display");
|
||||
APPL_DEBUG("DEBUG display");
|
||||
@ -81,8 +81,6 @@ int main(int _argc, const char *_argv[]) {
|
||||
APPL_WARNING("WARNING display");
|
||||
APPL_ERROR("ERROR display");
|
||||
APPL_PRINT("PRINT display");
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
//! [elog_sample_main]
|
||||
|
Loading…
x
Reference in New Issue
Block a user