-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathcrash_module.hpp
More file actions
44 lines (38 loc) · 1.74 KB
/
crash_module.hpp
File metadata and controls
44 lines (38 loc) · 1.74 KB
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
#ifndef CRASH_MODULE_HPP_
#define CRASH_MODULE_HPP_
#include <map>
#include <memory>
#include <string>
#include "countly/constants.hpp"
#include "countly/countly_configuration.hpp"
#include "countly/logger_module.hpp"
#include "countly/request_module.hpp"
namespace cly {
class CrashModule {
public:
~CrashModule();
CrashModule(std::shared_ptr<CountlyConfiguration> config, std::shared_ptr<LoggerModule> logger, std::shared_ptr<RequestModule> requestModule, std::shared_ptr<std::mutex> mutex);
/**
* Adds string value to a list which is later sent over as logs whenever a cash is reported by system.
*
* @param value: a bread crumb for the crash report
*/
void addBreadcrumb(const std::string &value);
/**
* Public method that sends crash details to the server. Set param "fatal" to false for Custom Logged errors
* @param title: a string that contains description of the exception.
* @param stackTrace: a string that describes the contents of the call-stack.
* @param segmentation: custom key/values to be reported
* @param crashMetrics: contains device information e.g app version, OS.
* In crash metrics '_os', '_app_version' and '_error' are mandatory.
* @param fatal: For automatically captured errors, you should set to 'true', whereas on logged errors it should be 'false'.
*/
void recordException(const std::string &title, const std::string &stackTrace, const bool fatal, const std::map<std::string, std::string> &crashMetrics, const std::map<std::string, std::string> &segmentation = {});
private:
friend class Countly;
class CrashModuleImpl;
std::unique_ptr<CrashModuleImpl> impl;
void setConfigurationProvider(std::weak_ptr<ConfigurationProvider> provider); // try injecting
};
} // namespace cly
#endif