discoverpixy
debuglog.h
1 //
2 // begin license header
3 //
4 // This file is part of Pixy CMUcam5 or "Pixy" for short
5 //
6 // All Pixy source code is provided under the terms of the
7 // GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html).
8 // Those wishing to use Pixy source code, software and/or
9 // technologies under different licensing terms should contact us at
10 // cmucam@cs.cmu.edu. Such licensing terms are available for
11 // all portions of the Pixy codebase presented here.
12 //
13 // end license header
14 //
15 #ifndef __DEBUG_H__
16 #define __DEBUG_H__
17 
18 #include <stdarg.h>
19 #include <stdio.h>
20 
21 static void log(const char *format, ...)
22 {
23 #ifdef DEBUG
24  va_list elements;
25 
26  // Send debug message to stdout //
27  va_start(elements, format);
28  vfprintf(stderr,format, elements);
29  fflush(stderr);
30  va_end(elements);
31  #else
32  (void)format;
33 #endif
34 }
35 
36 #endif