]> git.zerfleddert.de Git - proxmark3-svn/blame - client/ui.c
/client/Makefile: Output object files to the obj subdir.
[proxmark3-svn] / client / ui.c
CommitLineData
7fe9b0b7 1#include <stdarg.h>
2#include <stdio.h>
3#include <time.h>
4
5#include "ui.h"
6
7double CursorScaleFactor;
8int PlotGridX, PlotGridY;
9int offline;
10
11static char *logfilename = "proxmark3.log";
12
13void PrintAndLog(char *fmt, ...)
14{
15 va_list argptr, argptr2;
16 static FILE *logfile = NULL;
17 static int logging=1;
18
19 if (logging && !logfile) {
20 logfile=fopen(logfilename, "a");
21 if (!logfile) {
22 fprintf(stderr, "Can't open logfile, logging disabled!\n");
23 logging=0;
24 }
25 }
26
27 va_start(argptr, fmt);
28 va_copy(argptr2, argptr);
29 vprintf(fmt, argptr);
30 va_end(argptr);
31 printf("\n");
32 if (logging && logfile) {
7fe9b0b7 33 vfprintf(logfile, fmt, argptr2);
34 fprintf(logfile,"\n");
35 fflush(logfile);
36 }
37 va_end(argptr2);
38}
39
40void SetLogFilename(char *fn)
41{
42 logfilename = fn;
43}
Impressum, Datenschutz