Changeset 2939
- Timestamp:
- 2002-02-04T11:26:20+13:00 (22 years ago)
- Location:
- trunk/gsdl
- Files:
-
- 1 added
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/macros/english2.dm
r2935 r2939 941 941 _textlogs_ {Logs} 942 942 _textusagelog_ {usage log} 943 _textinitlog_ {init log}944 943 _texterrorlog_ {error log} 945 944 _textadminhome_ {admin home} -
trunk/gsdl/macros/status.dm
r2935 r2939 70 70 <p><b>_textlogs_</b><br> 71 71 <a href="_gwcgi_?e=_compressedoptions_&a=status&p=usagelog" target=infoframe>_textusagelog_</a><br> 72 <a href="_gwcgi_?e=_compressedoptions_&a=status&p=initlog" target=infoframe>_textinitlog_</a><br>73 72 <a href="_gwcgi_?e=_compressedoptions_&a=status&p=errorlog" target=infoframe>_texterrorlog_</a> 74 73 -
trunk/gsdl/src/recpt/cgiwrapper.cpp
r2344 r2939 193 193 errortext += "correctly.\n"; 194 194 195 text_t init_file = filename_cat (gsdlhome, "etc", "initout.txt"); 196 char *ifile = init_file.getcstr(); 197 ifstream initin (ifile); 198 delete ifile; 199 if (initin) { 200 errortext += "The initialisation error log, " + init_file + ", contains the\n"; 201 errortext += "following information:\n\n"; 202 if (!debug) errortext += "<pre>\n"; 203 204 char c; 205 initin.get(c); 206 while (!initin.eof ()) { 207 errortext.push_back(c); 208 initin.get(c); 209 } 210 211 if (!debug) errortext += "</pre>\n"; 212 213 initin.close(); 214 215 } else { 216 errortext += "Please consult " + init_file + " for more information.\n"; 217 } 218 219 format_error_string (errorpage, errortext, debug); 220 } 221 222 static void page_errorparseargs (const text_t &gsdlhome, bool debug, text_t &errorpage) { 223 224 text_t errortext = "An error occurred during the parsing of the cgi arguments.\n"; 225 226 text_t error_file = filename_cat (gsdlhome, "etc", "errout.txt"); 195 text_t error_file = filename_cat (gsdlhome, "etc", "error.txt"); 227 196 char *efile = error_file.getcstr(); 228 197 ifstream errin (efile); … … 239 208 errin.get(c); 240 209 } 210 241 211 if (!debug) errortext += "</pre>\n"; 212 242 213 errin.close(); 243 214 … … 249 220 } 250 221 251 static void page_error cgipage(const text_t &gsdlhome, bool debug, text_t &errorpage) {252 253 text_t errortext = "An error occurred during the construction of the cgi page.\n";254 255 text_t error_file = filename_cat (gsdlhome, "etc", "erro ut.txt");222 static void page_errorparseargs (const text_t &gsdlhome, bool debug, text_t &errorpage) { 223 224 text_t errortext = "An error occurred during the parsing of the cgi arguments.\n"; 225 226 text_t error_file = filename_cat (gsdlhome, "etc", "error.txt"); 256 227 char *efile = error_file.getcstr(); 257 228 ifstream errin (efile); … … 278 249 } 279 250 251 static void page_errorcgipage (const text_t &gsdlhome, bool debug, text_t &errorpage) { 252 253 text_t errortext = "An error occurred during the construction of the cgi page.\n"; 254 255 text_t error_file = filename_cat (gsdlhome, "etc", "error.txt"); 256 char *efile = error_file.getcstr(); 257 ifstream errin (efile); 258 delete efile; 259 if (errin) { 260 errortext += "The error log, " + error_file + ", contains the\n"; 261 errortext += "following information:\n\n"; 262 if (!debug) errortext += "<pre>\n"; 263 264 char c; 265 errin.get(c); 266 while (!errin.eof ()) { 267 errortext.push_back(c); 268 errin.get(c); 269 } 270 if (!debug) errortext += "</pre>\n"; 271 errin.close(); 272 273 } else { 274 errortext += "Please consult " + error_file + " for more information.\n"; 275 } 276 277 format_error_string (errorpage, errortext, debug); 278 } 279 280 280 static void print_debug_info (receptionist &recpt) { 281 281 … … 289 289 << "Configuration and initialization completed successfully.\n" 290 290 << " Note that more debug information may be available in the\n" 291 << " initialization and error logs initout.txt and errout.txt\n" 292 << " in " << etc_dir << ".\n" 291 << " initialization and error log error.txt in " << etc_dir << ".\n" 293 292 << "------------------------------------------------------------\n\n"; 294 293 … … 542 541 } 543 542 544 text_t init_file = filename_cat (gsdlhome, "etc", "initout.txt");545 char * iout = init_file.getcstr();546 ofstream initout (iout);547 delete iout;548 if (!recpt.init( initout)) {543 text_t error_file = filename_cat (gsdlhome, "etc", "error.txt"); 544 char *eout = error_file.getcstr(); 545 ofstream errout (eout, ios::app); 546 delete eout; 547 if (!recpt.init(errout)) { 549 548 // an error occurred during the initialisation 550 initout.close();549 errout.close(); 551 550 page_errorinit(gsdlhome, debug, errorpage); 552 551 } 553 initout.close();552 errout.close(); 554 553 } 555 554 … … 648 647 // output page 649 648 if (errorpage.empty()) { 650 text_t error_file = filename_cat (gsdlhome, "etc", "erro ut.txt");649 text_t error_file = filename_cat (gsdlhome, "etc", "error.txt"); 651 650 char *eout = error_file.getcstr(); 652 651 ofstream errout (eout, ios::app); -
trunk/gsdl/src/recpt/statusaction.cpp
r2935 r2939 772 772 } 773 773 774 void statusaction::output_initlog (cgiargsclass &/*args*/, displayclass &disp,775 outconvertclass &outconvert,776 ostream &textout, ostream &/*logout*/) {777 778 text_t initfilename = filename_cat (gsdlhome, "etc", "initout.txt");779 char *cinitfilename = initfilename.getcstr();780 if (cinitfilename == NULL) return;781 782 textout << outconvert << disp << "_status:infoheader_(Init log)\n";783 textout << outconvert << "<h2>Init log</h2>\n";784 785 #ifdef GSDL_USE_IOS_H786 ifstream initin (cinitfilename, ios::in | ios::nocreate);787 #else788 ifstream initin (cinitfilename, ios::in);789 #endif790 791 delete cinitfilename;792 if (initin) {793 textout << outconvert << "<p>The initialisation error log, "794 << initfilename << ", contains the\n";795 textout << outconvert << "following information:\n\n";796 text_t errorpage = "<p><pre>\n";797 798 char c;799 initin.get(c);800 while (!initin.eof ()) {801 errorpage.push_back(c);802 initin.get(c);803 }804 805 errorpage += "</pre>\n";806 initin.close();807 textout << outconvert << errorpage;808 809 } else {810 textout << outconvert << "Couldn't read initialisation error log, "811 << initfilename << ".\n";812 }813 814 textout << outconvert << disp << "_status:infofooter_\n";815 }816 817 774 void statusaction::output_errorlog (cgiargsclass &/*args*/, displayclass &disp, 818 775 outconvertclass &outconvert, 819 776 ostream &textout, ostream &logout) { 820 777 821 text_t errfilename = filename_cat (gsdlhome, "etc", "erro ut.txt");778 text_t errfilename = filename_cat (gsdlhome, "etc", "error.txt"); 822 779 char *cerrfilename = errfilename.getcstr(); 823 780 if (cerrfilename == NULL) return; … … 1142 1099 else if (arg_p == "collectioninfo") output_collectioninfo (args, disp, outconvert, textout, logout); 1143 1100 else if (arg_p == "usagelog") output_usagelog (args, disp, outconvert, textout, logout); 1144 else if (arg_p == "initlog") output_initlog (args, disp, outconvert, textout, logout);1145 1101 else if (arg_p == "errorlog") output_errorlog (args, disp, outconvert, textout, logout); 1146 1102 else if (arg_p == "gsdlsite") output_gsdlsite (args, disp, outconvert, textout, logout); -
trunk/gsdl/src/recpt/statusaction.h
r1837 r2939 79 79 ostream &textout, ostream &logout); 80 80 81 void output_initlog (cgiargsclass &args, displayclass &disp,82 outconvertclass &outconvert,83 ostream &textout, ostream &logout);84 85 81 void output_errorlog (cgiargsclass &args, displayclass &disp, 86 82 outconvertclass &outconvert,
Note:
See TracChangeset
for help on using the changeset viewer.