server_log.h 713 字节
Newer Older
xiaonuo911teamo's avatar
init...  
xiaonuo911teamo 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
#pragma once
#include <core/double_buffered_vector.hpp>
#include <message/messager.hpp>
#include <diag/frequence.hpp>
#include <diag/diagnose.hpp>
#include <pipe/timer_element.hpp>
#include "flogger.h"
class ServerLogElement : public TimerElement
{

public:
    ServerLogElement();

public:
    static void initial();

    const static ServerLogElement& instance(){
        static ServerLogElement l_instance;
        return l_instance;
    }
private:
    void error(const std::string& log);
    void info(const std::string& log);

    DoubleBufferedVector<std::string> _buffer_error;
    DoubleBufferedVector<std::string> _buffer_info;
    FLogger _floger;

private:
    virtual void timer_func() override;
};