forked from chengxumiaodaren/BuriedPoint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathburied_core.h
54 lines (39 loc) · 929 Bytes
/
buried_core.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once
#include <stdint.h>
#include <filesystem>
#include <memory>
#include <string>
#include "buried_common.h"
#include "include/buried.h"
namespace spdlog {
class logger;
}
namespace buried {
class BuriedReport;
}
struct Buried {
public:
struct Config {
std::string host;
std::string port;
std::string topic;
std::string user_id;
std::string app_version;
std::string app_name;
std::string custom_data;
};
public:
Buried(const std::string& work_dir);
~Buried();
BuriedResult Start(const Config& config);
BuriedResult Report(std::string title, std::string data, uint32_t priority);
public:
std::shared_ptr<spdlog::logger> Logger();
private:
void InitWorkPath_(const std::string& work_dir);
void InitLogger_();
private:
std::shared_ptr<spdlog::logger> logger_;
std::unique_ptr<buried::BuriedReport> buried_report_;
std::filesystem::path work_path_;
};