]> git.zerfleddert.de Git - proxmark3-svn/blame_incremental - client/gui.c
Added hitune command for continuously measuring HF antenna tuning
[proxmark3-svn] / client / gui.c
... / ...
CommitLineData
1#include <stdarg.h>
2#include <stdio.h>
3#include <time.h>
4
5#include "proxgui.h"
6#include "prox.h"
7
8int GraphBuffer[MAX_GRAPH_TRACE_LEN];
9int GraphTraceLen;
10double CursorScaleFactor;
11int PlotGridX, PlotGridY;
12int CommandFinished;
13int offline;
14
15static char *logfilename = "proxmark3.log";
16
17void PrintToScrollback(char *fmt, ...) {
18 va_list argptr, argptr2;
19 static FILE *logfile = NULL;
20 static int logging=1;
21
22 if (logging && !logfile) {
23 logfile=fopen(logfilename, "a");
24 if (!logfile) {
25 fprintf(stderr, "Can't open logfile, logging disabled!\n");
26 logging=0;
27 }
28 }
29
30 va_start(argptr, fmt);
31 va_copy(argptr2, argptr);
32 vprintf(fmt, argptr);
33 va_end(argptr);
34 printf("\n");
35 if (logging && logfile) {
36#if 0
37 char zeit[25];
38 time_t jetzt_t;
39 struct tm *jetzt;
40
41 jetzt_t = time(NULL);
42 jetzt = localtime(&jetzt_t);
43 strftime(zeit, 25, "%b %e %T", jetzt);
44
45 fprintf(logfile,"%s ", zeit);
46#endif
47 vfprintf(logfile, fmt, argptr2);
48 fprintf(logfile,"\n");
49 fflush(logfile);
50 }
51 va_end(argptr2);
52}
53
54void setlogfilename(char *fn)
55{
56 logfilename = fn;
57}
Impressum, Datenschutz