mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
ADD: some defines to make headerfiles behave better.
CHG: syntax sugar
This commit is contained in:
parent
bf5d7992ce
commit
2d3f8e5fa7
7 changed files with 82 additions and 58 deletions
15
client/ui.c
15
client/ui.c
|
@ -25,7 +25,10 @@ void PrintAndLog(char *fmt, ...)
|
|||
va_list argptr, argptr2;
|
||||
static FILE *logfile = NULL;
|
||||
static int logging = 1;
|
||||
|
||||
// time_t current_time;
|
||||
// struct tm* tm_info;
|
||||
// char buffer[26] = {0};
|
||||
|
||||
// lock this section to avoid interlacing prints from different threats
|
||||
pthread_mutex_lock(&print_lock);
|
||||
|
||||
|
@ -63,6 +66,16 @@ void PrintAndLog(char *fmt, ...)
|
|||
}
|
||||
|
||||
if (logging && logfile) {
|
||||
|
||||
/*
|
||||
// Obtain current time.
|
||||
current_time = time(NULL);
|
||||
// Convert to local time format.
|
||||
tm_info = localtime(¤t_time);
|
||||
strftime(buffer, 26, "%Y-%m-%d %H:%M:%S", tm_info);
|
||||
fprintf(logfile, "%s ", buffer);
|
||||
*/
|
||||
|
||||
vfprintf(logfile, fmt, argptr2);
|
||||
fprintf(logfile,"\n");
|
||||
fflush(logfile);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue