]>
git.proxmox.com Git - ovs.git/blob - lib/syslog-provider.h
2 * Copyright (c) 2015 Nicira, Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef SYSLOG_PROVIDER_H
18 #define SYSLOG_PROVIDER_H 1
21 /* Open vSwitch interface to syslog daemon's interface.
23 * 'syslogger' is the base class that provides abstraction. */
25 const struct syslog_class
*class; /* Virtual functions for concrete
26 * syslogger implementations. */
27 const char *prefix
; /* Prefix that is enforced by concrete
28 * syslogger implementation. Used
29 * in vlog/list-pattern function. */
32 /* Each concrete syslogger implementation must define it's own table with
33 * following functions. These functions must never call any other VLOG_
34 * function to prevent deadlocks. */
36 /* openlog() function should be called before syslog() function. It
37 * should initialize all system resources needed to perform logging. */
38 void (*openlog
)(struct syslogger
*this, int facility
);
40 /* syslog() function sends message 'msg' to syslog daemon. */
41 void (*syslog
)(struct syslogger
*this, int pri
, const char *msg
);
44 static inline const char *
45 syslog_get_prefix(struct syslogger
*this)
50 #endif /* syslog-provider.h */