📄 logger.h
字号:
/* Author: Tobi Vollebregt */
#ifndef LOGGER_H
#define LOGGER_H
#ifdef SYNCDEBUG
#include <stdio.h>
#include <boost/thread/mutex.hpp>
#include <string>
#include <vector>
/**
* @brief logging class for sync debugger
*
* Logging class with the special feature that it can replace "{hex address}"
* with "function [filename:lineno]".
*
* Specifically written for & used by the sync debugger.
*/
class CLogger {
public:
CLogger() : filename(NULL), logfile(NULL) {}
void AddLine(const char* fmt, ...)
#ifdef __GNUC__
__attribute__((format(printf, 2, 3)))
#endif
;
void CloseSession();
void SetFilename(const char* fn) { filename = fn; }
private:
// no copying
CLogger(const CLogger&);
CLogger& operator=(const CLogger&);
void FlushBuffer();
void CppFilt(char* sym, int size);
boost::mutex logmutex;
const char* filename;
FILE* logfile;
std::vector<std::string> buffer;
std::string exename;
};
#endif // SYNCDEBUG
#endif // LOGGER_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -