//
// SystemLogger.mm
// HighwayDash
//
// Created by John Ryland on 18/02/2016.
// Copyright © 2016 John Ryland. All rights reserved.
//
#if defined(__APPLE__)
#import "SystemLogger.h"
#import <Foundation/NSString.h>
void SystemLogger(const char* a_tag, const char* a_fmt, va_list a_args)
{
NSLogv([NSString stringWithUTF8String:a_fmt], a_args);
}
#else
#include <ctime>
#include <cstdio>
void SystemLogger(const char* a_tag, const char* a_fmt, va_list a_args)
{
time_t now = time(0);
struct tm tstruct = *localtime(&now);
printf("%04d-%02d-%02d %02d:%02d:%02d [%s] ", 1900+tstruct.tm_year, 1+tstruct.tm_mon,
tstruct.tm_mday, tstruct.tm_hour, tstruct.tm_min, tstruct.tm_sec, a_tag);
vprintf(a_fmt, a_args);
printf("\n");
}
#endif