Changeset 2939


Ignore:
Timestamp:
2002-02-04T11:26:20+13:00 (22 years ago)
Author:
sjboddie
Message:

All error messages now go to error.txt (i.e. did away with errout.txt and
initout.txt and put what used to go to them to error.txt instead)

Location:
trunk/gsdl
Files:
1 added
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/macros/english2.dm

    r2935 r2939  
    941941_textlogs_ {Logs}
    942942_textusagelog_ {usage log}
    943 _textinitlog_ {init log}
    944943_texterrorlog_ {error log}
    945944_textadminhome_ {admin home}
  • trunk/gsdl/macros/status.dm

    r2935 r2939  
    7070<p><b>_textlogs_</b><br>
    7171<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>
    7372<a href="_gwcgi_?e=_compressedoptions_&a=status&p=errorlog" target=infoframe>_texterrorlog_</a>
    7473
  • trunk/gsdl/src/recpt/cgiwrapper.cpp

    r2344 r2939  
    193193  errortext += "correctly.\n";
    194194
    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");
    227196  char *efile = error_file.getcstr();
    228197  ifstream errin (efile);
     
    239208      errin.get(c);
    240209    }
     210   
    241211    if (!debug) errortext += "</pre>\n";
     212
    242213    errin.close();
    243214
     
    249220}
    250221
    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", "errout.txt");
     222static 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");
    256227  char *efile = error_file.getcstr();
    257228  ifstream errin (efile);
     
    278249}
    279250
     251static 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
    280280static void print_debug_info (receptionist &recpt) {
    281281
     
    289289       << "Configuration and initialization completed successfully.\n"
    290290       << "  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"
    293292       << "------------------------------------------------------------\n\n";
    294293
     
    542541    }
    543542
    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)) {
    549548      // an error occurred during the initialisation
    550       initout.close();
     549      errout.close();
    551550      page_errorinit(gsdlhome, debug, errorpage);
    552551    }
    553     initout.close();
     552    errout.close();
    554553  }
    555554
     
    648647    // output page
    649648    if (errorpage.empty()) {
    650       text_t error_file = filename_cat (gsdlhome, "etc", "errout.txt");
     649      text_t error_file = filename_cat (gsdlhome, "etc", "error.txt");
    651650      char *eout = error_file.getcstr();
    652651      ofstream errout (eout, ios::app);
  • trunk/gsdl/src/recpt/statusaction.cpp

    r2935 r2939  
    772772}
    773773
    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_H
    786   ifstream initin (cinitfilename, ios::in | ios::nocreate);
    787 #else
    788   ifstream initin (cinitfilename, ios::in);
    789 #endif
    790 
    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 
    817774void statusaction::output_errorlog (cgiargsclass &/*args*/, displayclass &disp,
    818775                    outconvertclass &outconvert,
    819776                    ostream &textout, ostream &logout) {
    820777
    821   text_t errfilename = filename_cat (gsdlhome, "etc", "errout.txt");
     778  text_t errfilename = filename_cat (gsdlhome, "etc", "error.txt");
    822779  char *cerrfilename = errfilename.getcstr();
    823780  if (cerrfilename == NULL) return;
     
    11421099  else if (arg_p == "collectioninfo") output_collectioninfo (args, disp, outconvert, textout, logout);
    11431100  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);
    11451101  else if (arg_p == "errorlog") output_errorlog (args, disp, outconvert, textout, logout);
    11461102  else if (arg_p == "gsdlsite") output_gsdlsite (args, disp, outconvert, textout, logout);
  • trunk/gsdl/src/recpt/statusaction.h

    r1837 r2939  
    7979            ostream &textout, ostream &logout);
    8080
    81   void output_initlog (cgiargsclass &args, displayclass &disp,
    82                outconvertclass &outconvert,
    83                ostream &textout, ostream &logout);
    84 
    8581  void output_errorlog (cgiargsclass &args, displayclass &disp,
    8682            outconvertclass &outconvert,
Note: See TracChangeset for help on using the changeset viewer.