/src/openvswitch/lib/syslog-null.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2015, 2016 Nicira, Inc. |
3 | | * |
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: |
7 | | * |
8 | | * http://www.apache.org/licenses/LICENSE-2.0 |
9 | | * |
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. |
15 | | */ |
16 | | #include "syslog-null.h" |
17 | | |
18 | | #include <config.h> |
19 | | |
20 | | #include "compiler.h" |
21 | | #include "syslog-provider.h" |
22 | | #include "util.h" |
23 | | |
24 | | static void syslog_null_open(struct syslogger *this, int facility); |
25 | | static void syslog_null_log(struct syslogger *this, int pri, const char *msg); |
26 | | |
27 | | static struct syslog_class syslog_null_class = { |
28 | | syslog_null_open, |
29 | | syslog_null_log, |
30 | | }; |
31 | | |
32 | | struct syslog_null { |
33 | | struct syslogger parent; |
34 | | }; |
35 | | |
36 | | /* This function creates object that delegate all logging to null's |
37 | | * syslog implementation. */ |
38 | | struct syslogger * |
39 | | syslog_null_create(void) |
40 | 0 | { |
41 | 0 | struct syslog_null *this = xmalloc(sizeof *this); |
42 | |
|
43 | 0 | this->parent.class = &syslog_null_class; |
44 | 0 | this->parent.prefix = ""; |
45 | |
|
46 | 0 | return &this->parent; |
47 | 0 | } |
48 | | |
49 | | static void |
50 | | syslog_null_open(struct syslogger *this OVS_UNUSED, int facility OVS_UNUSED) |
51 | 0 | { |
52 | | /* Nothing to do. */ |
53 | 0 | } |
54 | | |
55 | | static void |
56 | | syslog_null_log(struct syslogger *this OVS_UNUSED, int pri OVS_UNUSED, |
57 | | const char *msg OVS_UNUSED) |
58 | 0 | { |
59 | | /* Nothing to do. */ |
60 | 0 | } |