~ubuntu-branches/ubuntu/jaunty/pcsc-lite/jaunty-security

« back to all changes in this revision

Viewing changes to src/debuglog.c

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Rousseau
  • Date: 2007-05-16 14:40:30 UTC
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20070516144030-6wk53ou910ctb9ds
Tags: upstream-1.4.1
ImportĀ upstreamĀ versionĀ 1.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 * Copyright (C) 1999-2005
7
7
 *  Ludovic Rousseau <ludovic.rousseau@free.fr>
8
8
 *
9
 
 * $Id: debuglog.c 2302 2007-01-06 17:57:58Z rousseau $
 
9
 * $Id: debuglog.c 2400 2007-02-17 15:04:03Z rousseau $
10
10
 */
11
11
 
12
12
/**
47
47
 
48
48
static signed char LogDoColor = 0;      /* no color by default */
49
49
 
 
50
static void log_line(const int priority, const char *DebugBuffer);
 
51
 
50
52
void log_msg(const int priority, const char *fmt, ...)
51
53
{
52
54
        char DebugBuffer[DEBUG_BUF_SIZE];
69
71
#endif
70
72
        va_end(argptr);
71
73
 
 
74
        log_line(priority, DebugBuffer);
 
75
} /* log_msg */
 
76
 
 
77
static void log_line(const int priority, const char *DebugBuffer)
 
78
{
72
79
#ifndef WIN32
73
80
        if (DEBUGLOG_SYSLOG_DEBUG == LogMsgType)
74
81
                syslog(LOG_INFO, "%s", DebugBuffer);
135
142
        if ((c >= debug_buf_end) && (i < len))
136
143
                c[-3] = c[-2] = c[-1] = '.';
137
144
 
138
 
#ifndef WIN32
139
 
        if (DEBUGLOG_SYSLOG_DEBUG == LogMsgType)
140
 
                syslog(LOG_INFO, "%s", DebugBuffer);
141
 
        else
142
 
#endif
143
 
                fprintf(stderr, "%s\n", DebugBuffer);
 
145
        log_line(priority, DebugBuffer);
144
146
} /* log_xxd */
145
147
 
146
148
#ifdef PCSCD