2
0
mirror of https://github.com/tenrok/Rfid-Credential-Provider.git synced 2026-05-15 11:59:44 +03:00
Files
rfid-credential-provider/Provider/RfidCredentialProvider/Logger.cpp
T
2019-11-29 15:55:40 +03:00

23 lines
438 B
C++

#include "common.h"
#include <stdio.h>
#include <time.h>
#include <iostream>
#include <string>
#include "Logger.h"
void Log(const char* toWrite) {
FILE* pFile;
time_t now;
struct tm* ts;
char buf[80];
now = time(NULL);
ts = localtime(&now);
strftime(buf, sizeof(buf), "%a %Y-%m-%d %H:%M:%S", ts);
pFile = fopen("C:\\RfidCredentialProvider.log.txt", "a");
fprintf(pFile, "%s\t%s\n", buf, toWrite);
fclose(pFile);
}