2
0

Fix login/result state import/export, keyID; Volto export; Pearl log sink.

This commit is contained in:
Maarten Billemont
2020-02-28 17:33:38 -05:00
parent b15417aa31
commit 131720eb8d
9 changed files with 159 additions and 93 deletions

View File

@@ -28,41 +28,11 @@ MP_LIBS_BEGIN
#include <libgen.h>
MP_LIBS_END
#define mpw_log_os(level, file, line, function, format, ...) \
do { \
if (mpw_verbosity < level) { \
break; \
} \
\
switch (level) { \
case LogLevelTrace: \
os_log_debug( OS_LOG_DEFAULT, "%30s:%-3ld TRC | " format, basename( (char *)file ), line, ##__VA_ARGS__ ); \
break; \
case LogLevelDebug: \
os_log_debug( OS_LOG_DEFAULT, "%30s:%-3ld DBG | " format, basename( (char *)file ), line, ##__VA_ARGS__ ); \
break; \
case LogLevelInfo: \
os_log_info( OS_LOG_DEFAULT, "%30s:%-3ld INF | " format, basename( (char *)file ), line, ##__VA_ARGS__ ); \
break; \
case LogLevelWarning: \
os_log( OS_LOG_DEFAULT, "%30s:%-3ld WRN | " format, basename( (char *)file ), line, ##__VA_ARGS__ ); \
break; \
case LogLevelError: \
os_log_error( OS_LOG_DEFAULT, "%30s:%-3ld ERR | " format, basename( (char *)file ), line, ##__VA_ARGS__ ); \
break; \
case LogLevelFatal: \
os_log_fault( OS_LOG_DEFAULT, "%30s:%-3ld FTL | " format, basename( (char *)file ), line, ##__VA_ARGS__ ); \
break; \
} \
\
mpw_log_sink( level, file, line, function, format, ##__VA_ARGS__ ); \
} while (0)
#ifdef __OBJC__
#import "Pearl-Prefix.pch"
#define MPW_LOG(level, file, line, function, format, ...) mpw_log_os(level, file, line, function, strf(format, ##__VA_ARGS__))
#define MPW_LOG(level, file, line, function, format, ...) mpw_log_sink(level, file, line, function, strf(format, ##__VA_ARGS__))
#if TARGET_OS_IOS
#import "MPTypes.h"
@@ -72,10 +42,6 @@ MP_LIBS_END
#import "MPMacConfig.h"
#endif
#else
#define MPW_LOG mpw_log_os
#endif
#include "mpw-util.h"