#pragma once #include #include #include template void WriteToLog(T &&... text) { #ifdef __APPLET__ std::stringstream ss; ((ss << text), ...); printf(ss.str().c_str()); printf("\n"); #else using namespace std; time_t unixTime = time(NULL); struct tm *time = localtime((const time_t *)&unixTime); fstream fs; fs.open("/atmosphere/titles/690000000000000D/log.txt", fstream::app); //Print time fs << setfill('0'); fs << setw(4) << (time->tm_year + 1900) << "-" << setw(2) << time->tm_mon << "-" << setw(2) << time->tm_mday << " " << setw(2) << time->tm_hour << ":" << setw(2) << time->tm_min << ":" << setw(2) << time->tm_sec << ": "; //Print the actual text ((fs << text), ...); fs << "\n"; fs.close(); #endif }