]> git.itanic.dy.fi Git - log-plotter/blob - debug.c
options: Fix short option for --baud
[log-plotter] / debug.c
1 #include <stdio.h>
2 #include <stdarg.h>
3
4 #include "debug.h"
5
6 int trace_level = TRACE_INFO;
7
8 void print_trace(const char *file, int line, int l,
9                 const char *fmt, ...)
10 {
11         FILE *out_file;
12         va_list args;
13
14         if (l > trace_level)
15                 return;
16
17         if (l == TRACE_ERR)
18                 out_file = stderr;
19         else
20                 out_file = stdout;
21
22         va_start(args, fmt);
23         vfprintf(out_file, fmt, args);
24         va_end(args);
25 }