aboutsummaryrefslogtreecommitdiff
path: root/web/logging.h
blob: 9ed4835170df00bc7663566b9b266fd6a7bb892d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
static int logger_id = -1;

void log(std::string s)
{
	if (logger_id == -1)
		return;

	callFunction(logger_id, s.c_str());
}

void log_wrapper(const char *cstr, void *data)
{
	log(cstr);
}

void set_logger(int id)
{
	logger_id = id;
	nissy::set_logger(log_wrapper, NULL);
}

Generated with cgit - Back to sebastiano.tronto.net