removed uneeded files

This commit is contained in:
gabime 2014-02-22 01:16:59 +02:00
parent c5a8eb5cdb
commit e27b45e3f0
7 changed files with 9 additions and 98 deletions

View File

@ -56,11 +56,11 @@ int main(int argc, char* argv[])
int qsize = atoi(argv[1]); int qsize = atoi(argv[1]);
int threads = atoi(argv[2]); int threads = atoi(argv[2]);
using namespace c11log::sinks; using namespace c11log;
auto null_sink = std::make_shared<null_sink>(); auto null_sink = std::make_shared<sinks::null_sink>();
auto stdout_sink = std::make_shared<stdout_sink>(); auto stdout_sink = std::make_shared<sinks::stdout_sink>();
auto async = std::make_shared<async_sink>(qsize); auto async = std::make_shared<sinks::async_sink>(qsize);
auto fsink = std::make_shared<rotating_file_sink>("example_log", "txt", 1024*1024*50 , 5); auto fsink = std::make_shared<sinks::rotating_file_sink>("example_log", "txt", 1024*1024*50 , 5);
async->add_sink(fsink); async->add_sink(fsink);

View File

@ -103,9 +103,7 @@ private:
std::mutex mutex_; std::mutex mutex_;
std::condition_variable item_pushed_cond_; std::condition_variable item_pushed_cond_;
std::condition_variable item_popped_cond_; std::condition_variable item_popped_cond_;
const std::chrono::hours one_hour { const std::chrono::hours one_hour (1);
1
};
}; };
} }

View File

@ -1,31 +0,0 @@
#pragma once
#include <chrono>
#include <string>
#include "../level.h"
namespace c11log {
namespace details {
struct message {
message(const std::string& logger_name,
level::level_enum log_level,
const std::chrono::system_clock::time_point time_p
, const std::string& msg) :
logger_name(logger_name),
log_level(log_level),
time_p(time_p),
msg(msg) {}
~message() = default;
message(const message& other) = default;
message& operator=(const message& rhs) = default;
std::string logger_name;
level::level_enum log_level;
std::chrono::system_clock::time_point time_p;
std::string msg;
};
}
}

View File

@ -1,15 +0,0 @@
#pragma once
namespace c11log {
namespace details {
struct null_mutex {
void lock() {
}
void unlock() {
}
bool try_lock() {
return true;
}
};
}
}

View File

@ -5,8 +5,8 @@
#include<functional> #include<functional>
#include <sstream> #include <sstream>
#include "../level.h" #include "level.h"
#include "../details/os.h" #include "details/os.h"
namespace c11log { namespace c11log {
namespace formatters { namespace formatters {

View File

@ -1,41 +0,0 @@
#pragma once
#include <sstream>
#include <iostream>
namespace c11log {
class log_exception :public std::exception {
public:
log_exception() : _oss(), _msg() {
}
virtual ~log_exception() {
}
explicit log_exception(const std::string& msg) :_oss(msg, std::ostringstream::ate), _msg(msg) {
}
log_exception(const log_exception &other) :_oss(other._oss.str()), _msg(other._msg) {
}
log_exception& operator=(const log_exception& other) {
_oss.str(other._oss.str());
_msg = other._msg;
return *this;
}
virtual const char* what() const throw () override {
return _msg.c_str();
}
template<typename T>
log_exception& operator<<(const T& what) {
_oss << what;
_msg = _oss.str();
return *this;
}
private:
std::ostringstream _oss;
std::string _msg;
};
}

View File

@ -3,7 +3,7 @@
#include<string> #include<string>
#include<atomic> #include<atomic>
#include "../formatters/formatters.h" #include "../formatter.h"
#include "../level.h" #include "../level.h"
namespace c11log { namespace c11log {