fix some issues

This commit is contained in:
Eduardo Bart
2011-12-09 13:01:04 -02:00
parent 2030a4da29
commit 8638c980ec
8 changed files with 23 additions and 21 deletions

View File

@@ -79,7 +79,7 @@ IF(WIN32)
ENDIF(NO_CONSOLE)
ELSE(WIN32)
SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -rdynamic")
SET(ADDITIONAL_LIBRARIES pthread X11)
SET(ADDITIONAL_LIBRARIES pthread X11 dl)
SET(framework_SOURCES ${framework_SOURCES} ${CMAKE_CURRENT_LIST_DIR}/platform/x11window.cpp)
ENDIF(WIN32)

View File

@@ -34,21 +34,17 @@ void Logger::log(Fw::LogLevel level, std::string message)
{
const static std::string logPrefixes[] = { "", "", "WARNING: ", "ERROR: ", "FATAL ERROR: " };
if(!m_terminated) {
message.insert(0, logPrefixes[level]);
std::cout << message << std::endl;
message.insert(0, logPrefixes[level]);
std::cout << message << std::endl;
std::size_t now = std::time(NULL);
m_logMessages.push_back(LogMessage(level, message, now));
std::size_t now = std::time(NULL);
m_logMessages.push_back(LogMessage(level, message, now));
if(m_onLog)
m_onLog(level, message, now);
}
if(m_onLog)
m_onLog(level, message, now);
if(level == Fw::LogFatal) {
m_terminated = true;
if(level == Fw::LogFatal)
throw std::runtime_error(message);
}
}
void Logger::logFunc(Fw::LogLevel level, const std::string& message, std::string prettyFunction)

View File

@@ -23,11 +23,7 @@
#ifndef LOGGER_H
#define LOGGER_H
#include "../util/tools.h"
#include "../const.h"
#include <vector>
#include <functional>
#include <list>
#include <framework/global.h>
struct LogMessage {
LogMessage(Fw::LogLevel level, const std::string& message, std::size_t when) : level(level), message(message), when(when) { }

View File

@@ -33,10 +33,7 @@ public:
bool setupWriteDir(const std::string& appWriteDirName);
/// Add an package or directory to the search path
bool addToSearchPath(const std::string& path, bool insertInFront = true);
/// Search and packages from a directory to the search path
void searchAndAddPackages(const std::string& packagesDir, const std::string& packagesExt, bool append);
bool fileExists(const std::string& fileName);