mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 13:03:27 +02:00
fix some issues
This commit is contained in:
@@ -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)
|
||||
|
||||
|
@@ -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)
|
||||
|
@@ -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) { }
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user