-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrlog_test.cpp
More file actions
39 lines (31 loc) · 880 Bytes
/
rlog_test.cpp
File metadata and controls
39 lines (31 loc) · 880 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
32
33
34
35
36
37
38
#include <iostream>
#include <string>
#include <thread>
#include <vector>
#include "rlog.hpp"
#define NUM_THREADS 10
rlog logger;
void addstuff(std::string name)
{
for(unsigned int i = 0; i < 1000; i++)
{
logger.log(name + " Hello!!!!" + " " + std::to_string(i));
logger.debug_log(name + " Thing " + std::to_string(i));
logger.warning_log(name + " Uhhhhhhhhhhhhh " + std::to_string(i));
logger.error_log(name + " Buffer overflowwwwwwwwwwwwwww " + std::to_string(i));
logger.fatal_log(name + " RIP program" + std::to_string(i));
}
}
int main(int argc, char** argv)
{
// std::cout << "SIZE OF rLOG " << sizeof(rlog) << std::endl;
std::vector<std::thread> threads;
for(unsigned int i = 0; i < NUM_THREADS; i++)
{
threads.push_back(std::thread(addstuff, std::to_string(i)));
}
for(unsigned int i = 0; i < threads.size(); i++)
{
threads[i].join();
}
}