-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexample.cpp
More file actions
31 lines (25 loc) · 789 Bytes
/
example.cpp
File metadata and controls
31 lines (25 loc) · 789 Bytes
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
#include "raven/raven.h"
#include <iostream>
int main(void)
{
try {
raven::Dsn::set_default("udp://12345678123456781234567812345678:01230123012301230123012301230123@127.0.0.1:12340/1");
} catch (std::exception& e) {
std::cout << "raven_init failed " << e.what() << std::endl;
return EXIT_FAILURE;
}
raven::Message msg;
msg.put("message", "this is message");
msg.put("extra.anything", "bla ba da ba da");
raven_info(msg);
raven::to_json_stream(msg, std::cout);
// raven custom
try {
raven::Dsn dsn("udp://11111111111111111111111111111111:22222222222222222222222222222222@127.0.0.1:12340/1", 0);
raven_debug(msg, dsn);
} catch (std::exception& e) {
std::cout << "raven_init_failed " << e.what() << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}