2
0
mirror of https://github.com/tenrok/Rfid-Credential-Provider.git synced 2026-05-21 13:24:13 +03:00
Files
rfid-credential-provider/Provider/RfidCredentialProvider/Logger.cpp
T
2012-02-26 13:07:01 -08:00

23 lines
441 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);
}