00001 /** @file 00002 00003 A brief file description 00004 00005 @section license License 00006 00007 Licensed to the Apache Software Foundation (ASF) under one 00008 or more contributor license agreements. See the NOTICE file 00009 distributed with this work for additional information 00010 regarding copyright ownership. The ASF licenses this file 00011 to you under the Apache License, Version 2.0 (the 00012 "License"); you may not use this file except in compliance 00013 with the License. You may obtain a copy of the License at 00014 00015 http://www.apache.org/licenses/LICENSE-2.0 00016 00017 Unless required by applicable law or agreed to in writing, software 00018 distributed under the License is distributed on an "AS IS" BASIS, 00019 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00020 See the License for the specific language governing permissions and 00021 limitations under the License. 00022 */ 00023 00024 #ifndef LOG_PREDEFINED_H 00025 #define LOG_PREDEFINED_H 00026 00027 #include "libts.h" 00028 00029 class LogFormat; 00030 class LogConfig; 00031 00032 // Collects all the necesary info to build a pre-defined object. 00033 struct PreDefinedFormatInfo 00034 { 00035 LogFormat * format; 00036 const char * filename; 00037 const char * header; 00038 LogFileFormat filefmt; 00039 bool collatable; // whether log collation is supported 00040 00041 LINK(PreDefinedFormatInfo, link); 00042 00043 PreDefinedFormatInfo(LogFormat * fmt, const char * fname, const char * hdr, LogFileFormat _f, bool _c) 00044 :format(fmt), filename(fname), header(hdr), filefmt(_f), collatable(_c) 00045 { } 00046 00047 static const char * const squid; 00048 static const char * const common; 00049 static const char * const extended; 00050 static const char * const extended2; 00051 }; 00052 00053 typedef Queue<PreDefinedFormatInfo> PreDefinedFormatInfoList; 00054 00055 struct PreDefinedFormatList 00056 { 00057 PreDefinedFormatList(); 00058 ~PreDefinedFormatList(); 00059 00060 // Initialize the predefined format list from the given LogConfig. This has the side-effect of 00061 // adding the predefined LogFormats to the LogConfig global_format_list. 00062 void init(LogConfig * config); 00063 00064 PreDefinedFormatInfoList formats; 00065 }; 00066 00067 // Return a PreDefinedFormatInfo structure for the ASCII error log. 00068 PreDefinedFormatInfo * 00069 MakePredefinedErrorLog(LogConfig * config); 00070 00071 #endif /* LOG_PREDEFINED_H */