blocxx
LogConfig.hpp
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright (C) 2004 Vintela, Inc. All rights reserved.
3 * Copyright (C) 2005 Novell, Inc. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * - Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 *
11 * - Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 *
15 * - Neither the name of Vintela, Inc., Novell, Inc., nor the names of its
16 * contributors may be used to endorse or promote products derived from this
17 * software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL Vintela, Inc., Novell, Inc., OR THE
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *******************************************************************************/
31 
32 
37 #ifndef BLOCXX_LOGCONFIG_HPP_
38 #define BLOCXX_LOGCONFIG_HPP_
39 
40 #include "blocxx/BLOCXX_config.h"
42 #include "blocxx/LogLevel.hpp"
43 
44 namespace BLOCXX_NAMESPACE
45 {
46 
48 {
51 };
52 
54 
55 
56 #ifndef BLOCXX_DEFAULT_LOG_1_MAX_FILE_SIZE
57 #define BLOCXX_DEFAULT_LOG_1_MAX_FILE_SIZE "0"
58 #endif
59 
60 #ifndef BLOCXX_DEFAULT_LOG_1_MAX_BACKUP_INDEX
61 #define BLOCXX_DEFAULT_LOG_1_MAX_BACKUP_INDEX "1"
62 #endif
63 
64 #ifndef BLOCXX_DEFAULT_LOG_1_FLUSH
65 #define BLOCXX_DEFAULT_LOG_1_FLUSH "true"
66 #endif
67 
68 #ifndef BLOCXX_DEFAULT_LOG_1_SYSLOG_IDENTITY
69 #define BLOCXX_DEFAULT_LOG_1_SYSLOG_IDENTITY BLOCXX_PACKAGE_PREFIX"blocxx"
70 #endif
71 
72 #ifndef BLOCXX_DEFAULT_LOG_1_SYSLOG_FACILITY
73 #define BLOCXX_DEFAULT_LOG_1_SYSLOG_FACILITY "user"
74 #endif
75 
76 namespace LogConfigOptions
77 {
78  extern const char* const LOG_1_LOCATION_opt;
79  extern const char* const LOG_1_MAX_FILE_SIZE_opt;
80  extern const char* const LOG_1_MAX_BACKUP_INDEX_opt;
81  extern const char* const LOG_1_FLUSH_opt;
82  extern const char* const LOG_1_SYSLOG_IDENTITY_opt;
83  extern const char* const LOG_1_SYSLOG_FACILITY_opt;
84 
86  {
87  const char* name;
88  const char* defaultValue;
89  };
90  extern const NameAndDefault g_defaults[];
91  extern const NameAndDefault* const g_defaultsEnd;
92 
93 } // end namespace LogConfigOptions
94 
95 
96 } // end namespace BLOCXX_NAMESPACE
97 
98 #endif // BLOCXX_LOGCONFIG_HPP_