summaryrefslogtreecommitdiff
path: root/lib/mlibc/options/internal/generic/debug.cpp
blob: 19427c8ac28353a42f4a2984f11024c3738c9436 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

#include <bits/ensure.h>
#include <mlibc/debug.hpp>
#include <mlibc/internal-sysdeps.hpp>

namespace mlibc {

frg::stack_buffer_logger<InfoSink, 512> infoLogger;
frg::stack_buffer_logger<PanicSink, 512> panicLogger;

void InfoSink::operator() (const char *message) {
	sys_libc_log(message);
}

void PanicSink::operator() (const char *message) {
//	sys_libc_log("mlibc: Write to PanicSink");
	sys_libc_log(message);
	sys_libc_panic();
}

} // namespace mlibc