00001 // This file is part of BOINC. 00002 // http://boinc.berkeley.edu 00003 // Copyright (C) 2008 University of California 00004 // 00005 // BOINC is free software; you can redistribute it and/or modify it 00006 // under the terms of the GNU Lesser General Public License 00007 // as published by the Free Software Foundation, 00008 // either version 3 of the License, or (at your option) any later version. 00009 // 00010 // BOINC is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00013 // See the GNU Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public License 00016 // along with BOINC. If not, see <http://www.gnu.org/licenses/>. 00017 00018 // flags determining what is written to standard out. 00019 // (errors go to stderr) 00020 // 00021 // NOTE: all writes to stdout should have an if (log_flags.*) {} around them. 00022 // 00023 00024 #ifndef _LOGFLAGS_H_ 00025 #define _LOGFLAGS_H_ 00026 00027 #include <vector> 00028 #include <string> 00029 00030 #ifndef _WIN32 00031 #include <stdio.h> 00032 #endif 00033 00034 #define MAX_FILE_XFERS_PER_PROJECT 2 00035 #define MAX_FILE_XFERS 8 00036 // kind of arbitrary 00037 00038 class XML_PARSER; 00039 00040 struct LOG_FLAGS { 00041 // on by default, user-readable 00042 // 00044 bool task; 00046 bool file_xfer; 00048 bool sched_ops; 00049 00050 // off by default; intended for developers and testers 00051 // 00053 bool cpu_sched; 00055 bool cpu_sched_debug; 00057 bool rr_simulation; 00059 bool debt_debug; 00061 bool task_debug; 00063 bool work_fetch_debug; 00064 00066 bool unparsed_xml; 00071 bool state_debug; 00073 bool file_xfer_debug; 00074 bool sched_op_debug; 00075 bool http_debug; 00076 bool proxy_debug; 00078 bool time_debug; 00079 bool http_xfer_debug; 00081 bool benchmark_debug; 00083 bool poll_debug; 00084 bool guirpc_debug; 00085 bool scrsave_debug; 00087 bool app_msg_send; 00089 bool app_msg_receive; 00091 bool mem_usage_debug; 00092 bool network_status_debug; 00093 bool checkpoint_debug; 00095 bool coproc_debug; 00096 00097 LOG_FLAGS(); 00098 void defaults(); 00099 int parse(XML_PARSER&); 00100 void show(); 00101 }; 00102 00103 struct CONFIG { 00104 bool dont_check_file_sizes; 00105 bool http_1_0; 00106 int save_stats_days; 00107 int ncpus; 00108 int max_file_xfers; 00109 int max_file_xfers_per_project; 00110 bool suppress_net_info; 00111 bool disallow_attach; 00112 bool os_random_only; 00113 bool no_alt_platform; 00114 bool simple_gui_only; 00115 bool dont_contact_ref_site; 00116 std::vector<std::string> alt_platforms; 00117 int max_stdout_file_size; 00118 int max_stderr_file_size; 00119 bool report_results_immediately; 00120 double start_delay; 00121 bool run_apps_manually; 00122 std::string force_auth; 00123 bool allow_multiple_clients; 00124 bool use_certs; 00125 bool use_certs_only; 00126 // overrides use_certs 00127 std::vector<std::string> exclusive_apps; 00128 00129 CONFIG(); 00130 void defaults(); 00131 int parse(FILE*); 00132 int parse_options(XML_PARSER&); 00133 }; 00134 00135 extern LOG_FLAGS log_flags; 00136 extern CONFIG config; 00137 extern int read_config_file(); 00138 00139 #endif
1.5.6