line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
MODE: INLINE |
2
|
|
|
|
|
|
|
#include |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
struct XSConsoleLogger : ConsoleLogger { |
5
|
|
|
|
|
|
|
using ConsoleLogger::ConsoleLogger; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
void log (const string& msg, const Info&) override { |
8
|
|
|
|
|
|
|
Io io = PL_defoutgv; |
9
|
|
|
|
|
|
|
if (!io) return; |
10
|
|
|
|
|
|
|
auto fp = io.ofp(); |
11
|
|
|
|
|
|
|
if (!fp) return; |
12
|
|
|
|
|
|
|
PerlIO_write(fp, msg.data(), msg.length()); |
13
|
|
|
|
|
|
|
PerlIO_write(fp, "\n", 1); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
}; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
namespace xs { |
18
|
|
|
|
|
|
|
template struct Typemap : Typemap { |
19
|
|
|
|
|
|
|
static string package () { return "XLog::Console"; } |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
template <> struct Typemap : Typemap {}; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
MODULE = XLog PACKAGE = XLog::Console |
25
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
BOOT { |
28
|
8
|
50
|
|
|
|
|
Stash(__PACKAGE__).inherit("XLog::ILogger"); |
|
|
50
|
|
|
|
|
|
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
2
|
|
|
|
|
|
XSConsoleLogger* XSConsoleLogger::new () |