summaryrefslogtreecommitdiff
path: root/def.c
blob: 55bd7fa628fb6c0ca4d99a63843e0f01daa6be84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * pin.c: A plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 * Date: 11.04.05 - 12.02.07, horchi
 */

//***************************************************************************
// Include
//***************************************************************************

#include <stdarg.h>
#include <syslog.h>

#include "def.h"

int logLevel = eloOff;

//***************************************************************************
// Tell
//***************************************************************************

int tell(int eloquence, const char* format, ...)
{
   char tmp[1024];
   va_list ap;

   va_start(ap, format);

   if (logLevel >= eloquence)
   {
      vsnprintf(tmp + 5, sizeof tmp - 5, format, ap);
      memcpy(tmp, "[pin] ", 5);
      syslog(LOG_INFO, "%s", tmp);
   }

   va_end(ap);

   return success;
}