src/xs/xlog.h

filter: Statementstmt 50.0% 2 / 4 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 50.0% 3 / 6 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« xs/util.cc ↑ Summary xs/Module.xsi »
1 #pragma once
2 #include <xs.h>
3 #include <panda/log.h>
4 #include <panda/exception.h>
5  
6 // typemaps
7 namespace xs {
8 template <> struct Typemap<panda::log::Level> : TypemapBase<panda::log::Level> {
9 static inline panda::log::Level in (SV* sv) {
10 int l = SvIV(sv);
11 if (l < (int)panda::log::Level::VerboseDebug || l > (int)panda::log::Level::Emergency) throw panda::exception("invalid log level");
12 return (panda::log::Level)l;
13 }
14 155 static inline Sv out (panda::log::Level l, const Sv& = {}) {
15 155 ▶ return Simple((int)l);
Branch: 1 branch
BranchTrueFalseTotal
return Simple((int)l); 155 0 155
16 }
17 };
18  
19 template <class TYPE> struct Typemap<panda::log::ILogger*, TYPE> : TypemapObject<panda::log::ILogger*, TYPE, ObjectTypeRefcntPtr, ObjectStorageMGBackref> {
20 0 static panda::string package () { return "XLog::ILogger"; }
21 };
22  
23 template <> struct Typemap<panda::log::ILoggerSP> : Typemap<panda::log::ILogger*> {
24 static panda::log::ILoggerSP in (Sv arg);
25 };
26  
27 template <class TYPE> struct Typemap<panda::log::IFormatter*, TYPE> : TypemapObject<panda::log::IFormatter*, TYPE, ObjectTypeRefcntPtr, ObjectStorageMGBackref> {
28 0 static panda::string package () { return "XLog::IFormatter"; }
29 };
30  
31 template <> struct Typemap<panda::log::IFormatterSP> : Typemap<panda::log::IFormatter*> {
32 static panda::log::IFormatterSP in (Sv arg);
33 };
34  
35 template <class TYPE> struct Typemap<panda::log::Module*, TYPE> : TypemapObject<panda::log::Module*, TYPE, ObjectTypeForeignPtr, ObjectStorageMG> {
36 static panda::string package () { return "XLog::Module"; }
37 };
38 }
« xs/util.cc ↑ Summary xs/Module.xsi »