diff options
Diffstat (limited to 'src/components/utils/src/system.cc')
-rw-r--r-- | src/components/utils/src/system.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/components/utils/src/system.cc b/src/components/utils/src/system.cc index 2acc7acf92..d8bd034d4a 100644 --- a/src/components/utils/src/system.cc +++ b/src/components/utils/src/system.cc @@ -49,7 +49,7 @@ namespace utils { -CREATE_LOGGERPTR_LOCAL(logger_, "Utils") +SDL_CREATE_LOG_VARIABLE("Utils") struct GetCString { char* operator()(const std::string& string) { @@ -96,8 +96,7 @@ bool System::Execute(bool wait) { delete[] argv; if (ret == -1) { - LOG4CXX_ERROR(logger_, - "Can't execute command: " << command_ << " Errno is: " + SDL_LOG_ERROR("Can't execute command: " << command_ << " Errno is: " << std::strerror(errno)); return false; } @@ -117,13 +116,13 @@ bool System::Execute(bool wait) { switch (pid_command) { case -1: { // Error - LOG4CXX_FATAL(logger_, "fork() failed!"); + SDL_LOG_FATAL("fork() failed!"); return false; } case 0: { // Child process int32_t fd_dev0 = open("/dev/null", O_RDWR, S_IWRITE); if (0 > fd_dev0) { - LOG4CXX_FATAL(logger_, "Open dev0 failed!"); + SDL_LOG_FATAL("Open dev0 failed!"); return false; } // close input/output file descriptors. @@ -143,7 +142,7 @@ bool System::Execute(bool wait) { // Execute the program. if (execvp(command_.c_str(), argv) == -1) { - LOG4CXX_ERROR(logger_, "Can't execute command: " << command_); + SDL_LOG_ERROR("Can't execute command: " << command_); _exit(EXIT_FAILURE); } delete[] argv; @@ -151,14 +150,14 @@ bool System::Execute(bool wait) { return true; } default: { /* Parent process */ - LOG4CXX_INFO(logger_, "Process created with pid " << pid_command); + SDL_LOG_INFO("Process created with pid " << pid_command); if (wait) { int status; pid_t wait_pid; do { wait_pid = waitpid(pid_command, &status, WUNTRACED | WCONTINUED); if (wait_pid == -1) { - LOG4CXX_ERROR_WITH_ERRNO(logger_, "Can't wait"); + SDL_LOG_ERROR_WITH_ERRNO("Can't wait"); _exit(EXIT_FAILURE); return false; } |