source: vendor/synergy/current/lib/arch/CArchLogUnix.cpp

Last change on this file was 2749, checked in by bird, 19 years ago

synergy v1.3.1 sources (zip).

File size: 1.3 KB
Line 
1/*
2 * synergy -- mouse and keyboard sharing utility
3 * Copyright (C) 2002 Chris Schoeneman
4 *
5 * This package is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * found in the file COPYING that should have accompanied this file.
8 *
9 * This package is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#include "CArchLogUnix.h"
16#include <syslog.h>
17
18//
19// CArchLogUnix
20//
21
22CArchLogUnix::CArchLogUnix()
23{
24 // do nothing
25}
26
27CArchLogUnix::~CArchLogUnix()
28{
29 // do nothing
30}
31
32void
33CArchLogUnix::openLog(const char* name)
34{
35 openlog(name, 0, LOG_DAEMON);
36}
37
38void
39CArchLogUnix::closeLog()
40{
41 closelog();
42}
43
44void
45CArchLogUnix::showLog(bool)
46{
47 // do nothing
48}
49
50void
51CArchLogUnix::writeLog(ELevel level, const char* msg)
52{
53 // convert level
54 int priority;
55 switch (level) {
56 case kERROR:
57 priority = LOG_ERR;
58 break;
59
60 case kWARNING:
61 priority = LOG_WARNING;
62 break;
63
64 case kNOTE:
65 priority = LOG_NOTICE;
66 break;
67
68 case kINFO:
69 priority = LOG_INFO;
70 break;
71
72 default:
73 priority = LOG_DEBUG;
74 break;
75 }
76
77 // log it
78 syslog(priority, "%s", msg);
79}
Note: See TracBrowser for help on using the repository browser.