Contains main function definition for logcat. More...
#include "ink_config.h"
#include "ink_file.h"
#include "I_Layout.h"
#include "I_Version.h"
#include <poll.h>
#include "LogStandalone.cc"
#include "LogAccess.h"
#include "LogField.h"
#include "LogFilter.h"
#include "LogFormat.h"
#include "LogFile.h"
#include "LogHost.h"
#include "LogObject.h"
#include "LogConfig.h"
#include "LogBuffer.h"
#include "LogUtils.h"
#include "LogSock.h"
#include "LogPredefined.h"
#include "Log.h"
Go to the source code of this file.
Defines | |
#define | PROGRAM_NAME "traffic_logcat" |
#define | MAX_LOGBUFFER_SIZE 65536 |
Functions | |
static int | process_file (int in_fd, int out_fd) |
static int | open_output_file (char *output_file) |
int | main (int, char *argv[]) |
Variables | |
static int | version_flag = 0 |
static int | help = 0 |
static int | squid_flag = 0 |
static int | follow_flag = 0 |
static int | clf_flag = 0 |
static int | elf_flag = 0 |
static int | elf2_flag = 0 |
static int | auto_filenames = 0 |
static int | overwrite_existing_file = 0 |
static char | output_file [1024] |
int | auto_clear_cache_flag = 0 |
static const ArgumentDescription | argument_descriptions [] |
static const char * | USAGE_LINE = "Vw2] [input-file ...]" |
Contains main function definition for logcat.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file logcat.cc.
#define MAX_LOGBUFFER_SIZE 65536 |
#define PROGRAM_NAME "traffic_logcat" |
int main | ( | int | , | |
char * | argv[] | |||
) |
Definition at line 223 of file logcat.cc.
References appVersionInfo, ats_free(), ats_malloc(), auto_filenames, BUILD_MACHINE, BUILD_PERSON, countof, Layout::create(), file_arguments, follow_flag, AppVersionInfo::FullVersionInfoStr, help, Log::init(), init_log_standalone_basic(), LOG_FILE_ASCII_OBJECT_FILENAME_EXTENSION, LOG_FILE_BINARY_OBJECT_FILENAME_EXTENSION, Log::LOGCAT, memcpy, n_file_arguments, Log::NO_REMOTE_MANAGEMENT, open_output_file(), output_file, PACKAGE_NAME, PACKAGE_VERSION, process_args(), process_file(), PROGRAM_NAME, AppVersionInfo::setup(), usage(), USAGE_LINE, and version_flag.
static int open_output_file | ( | char * | output_file | ) | [static] |
static int process_file | ( | int | in_fd, | |
int | out_fd | |||
) | [static] |
Definition at line 89 of file logcat.cc.
References LogBufferHeader::byte_count, clf_flag, PreDefinedFormatInfo::common, LogBufferHeader::cookie, Debug, elf2_flag, elf_flag, PreDefinedFormatInfo::extended, PreDefinedFormatInfo::extended2, LogBufferHeader::fmt_fieldlist(), follow_flag, LOG_SEGMENT_COOKIE, PreDefinedFormatInfo::squid, squid_flag, and LogFile::write_ascii_logbuffer().
Referenced by main().
const ArgumentDescription argument_descriptions[] [static] |
{ {"output_file", 'o', "Specify output file", "S1023", &output_file, NULL, NULL}, {"auto_filenames", 'a', "Automatically generate output names", "T", &auto_filenames, NULL, NULL}, {"follow", 'f', "Follow the log file as it grows", "T", &follow_flag, NULL, NULL}, {"clf", 'C', "Convert to Common Logging Format", "T", &clf_flag, NULL, NULL}, {"elf", 'E', "Convert to Extended Logging Format", "T", &elf_flag, NULL, NULL}, {"help", 'h', "Give this help", "T", &help, NULL, NULL}, {"squid", 'S', "Convert to Squid Logging Format", "T", &squid_flag, NULL, NULL}, {"debug_tags", 'T', "Colon-Separated Debug Tags", "S1023", error_tags, NULL, NULL}, {"version", 'V', "Print Version Id", "T", &version_flag, NULL, NULL}, {"overwrite_output", 'w', "Overwrite existing output file(s)", "T", &overwrite_existing_file, NULL, NULL}, {"elf2", '2', "Convert to Extended2 Logging Format", "T", &elf2_flag, NULL, NULL} }
Definition at line 62 of file logcat.cc.
Referenced by main(), and CommandLineArgs::parse_arguments().
int auto_clear_cache_flag = 0 |
int auto_filenames = 0 [static] |
int clf_flag = 0 [static] |
Definition at line 54 of file logcat.cc.
Referenced by process_file().
int elf2_flag = 0 [static] |
Definition at line 56 of file logcat.cc.
Referenced by process_file().
int elf_flag = 0 [static] |
Definition at line 55 of file logcat.cc.
Referenced by process_file().
int follow_flag = 0 [static] |
Definition at line 53 of file logcat.cc.
Referenced by main(), and process_file().
char output_file[1024] [static] |
int overwrite_existing_file = 0 [static] |
Definition at line 58 of file logcat.cc.
Referenced by open_output_file().
int squid_flag = 0 [static] |
Definition at line 52 of file logcat.cc.
Referenced by process_file().
const char* USAGE_LINE = "Vw2] [input-file ...]" [static] |
int version_flag = 0 [static] |