33ce5a3b4d23e2b463b4e80c3d8e49b14af86ade
[oweals/cde.git] / cde / lib / csa / debug.c
1 /* $XConsortium: debug.c /main/3 1996/11/21 20:00:19 drk $ */
2 /*
3  *  (c) Copyright 1993, 1994 Hewlett-Packard Company
4  *  (c) Copyright 1993, 1994 International Business Machines Corp.
5  *  (c) Copyright 1993, 1994 Novell, Inc.
6  *  (c) Copyright 1993, 1994 Sun Microsystems, Inc.
7  */
8
9 #include <stdio.h>
10
11 #define X_INCLUDE_TIME_H
12 #define XOS_USE_NO_LOCKING
13 #include <X11/Xos_r.h>
14
15 #include <syslog.h>
16
17 static int inited = 0;
18
19 extern void
20 _DtCm_print_tick(time_t t)
21 {
22         char *a;
23         _Xctimeparams ctime_buf;
24  
25         a = _XCtime(&t, ctime_buf);
26         (void) fprintf (stderr, "%d %s\n", t, a);
27 }
28
29 extern void
30 _DtCm_print_errmsg(const char *msg)
31 {
32         if (inited == 0) {
33                 openlog("libcsa", 0, 0);
34                 inited = 1;
35         }
36
37 #ifdef CM_DEBUG
38         fprintf(stderr, "libcsa: %s\n", msg);
39 #else
40         syslog(LOG_ERR, "%s\n", msg);
41 #endif
42
43 }
44