mirror of
https://github.com/ish-app/ish.git
synced 2026-05-28 21:10:35 +00:00
Add support for kprintf via syslog() and MacOS os_log().
This seems moderately successful, I was able to get logging out of the CLI build with syslog(). I may marely have been having trouble with logging on my Mac.
This commit is contained in:
@@ -3,9 +3,13 @@
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <sys/uio.h>
|
||||
#include <syslog.h>
|
||||
#if LOG_HANDLER_NSLOG
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#endif
|
||||
#if LOG_HANDLER_OS_LOG
|
||||
#include <os/log.h>
|
||||
#endif
|
||||
#include "kernel/calls.h"
|
||||
#include "util/sync.h"
|
||||
#include "util/fifo.h"
|
||||
@@ -142,6 +146,14 @@ static void log_line(const char *line) {
|
||||
extern void NSLog(CFStringRef msg, ...);
|
||||
NSLog(CFSTR("%s"), line);
|
||||
}
|
||||
#elif LOG_HANDLER_SYSLOG
|
||||
static void log_line(const char *line) {
|
||||
syslog(LOG_DEBUG, "%s", line);
|
||||
}
|
||||
#elif LOG_HANDLER_OS_LOG
|
||||
static void log_line(const char *line) {
|
||||
os_log_fault(OS_LOG_DEFAULT, "%s", line);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void default_die_handler(const char *msg) {
|
||||
|
||||
Reference in New Issue
Block a user