Changeset 8088 for trunk/MagicSoft/Mars
- Timestamp:
- 10/17/06 13:57:59 (18 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8087 r8088 18 18 19 19 -*-*- END OF LINE -*-*- 20 2006/10/17 Thomas Bretz 21 22 * mdata/MDataPhrase.cc: 23 - updated comments 24 - only add the missing functions to TDataPrimitives when not 25 yet done. Everything lse would leak memory 26 27 * mhbase/MH3.[h,cc], mhvstime/MHVsTime.[h,cc]: 28 - exchanged the MDataChain by MDataPhrase 29 - therefore changed the datamember from MDataChain* to MData* 30 (this change is not necessarily backward compatible) 31 - increased class version number by one 32 33 * mraw/MRawRunHeader.h: 34 - added getter for fObservationMode 35 36 * callisto.cc, ganymed.cc, merpp.cc, readdaq.cc, readraw.cc, 37 showplot.cc, sinope.cc, star.cc, rootlogon.C 38 - enabled error redirection 39 40 * mbase/MLog.[h,cc]: 41 - added code to allow redirection of root error handler to 42 out own error handler 43 44 45 20 46 2006/10/17 Markus Meyer 21 47 22 * mtools 23 - added a new class called MRolke, which is a modification of24 TRolke from root_v5.12.00b. There is now a new function, called25 LogFactorial() which enables to calculate confidence intervals26 even for a large number of events (larger than 170).48 * mtools/MRolke.[h,cc]: 49 - added: a modification of TRolke from root_v5.12.00b. There is 50 now a new function, called LogFactorial() which enables to 51 calculate confidence intervals even for a large number of 52 events (larger than 170). 27 53 28 54 … … 78 104 * mbase/MMath.cc: 79 105 - small update to SolvePol3 which is more accurate in the number 80 o rdifferent solutions106 of different solutions 81 107 82 108 * mdata/DataLinkDef.h, mdata/Makefile: -
trunk/MagicSoft/Mars/NEWS
r8071 r8088 5 5 - general: The programs now return 0xfe if the requested resource file 6 6 doesn't exist. 7 8 - general: Errors comming from root itself are now not output to 9 stderr anymore but to our default (colored) log-stream. 7 10 8 11 -
trunk/MagicSoft/Mars/callisto.cc
r8071 r8088 145 145 return 0xff; 146 146 147 MLog::RedirectErrorHandler(MLog::kColor); 148 147 149 // 148 150 // Evaluate arguments -
trunk/MagicSoft/Mars/ganymed.cc
r8071 r8088 94 94 return 0xff; 95 95 96 MLog::RedirectErrorHandler(MLog::kColor); 97 96 98 // 97 99 // Evaluate arguments -
trunk/MagicSoft/Mars/macros/rootlogon.C
r7413 r8088 122 122 return; 123 123 124 MLog::RedirectErrorHandler(MLog::kColor); 125 124 126 gInterpreter->AddIncludePath(dir+"macros"); 125 127 gInterpreter->AddIncludePath(dir+"manalysis"); -
trunk/MagicSoft/Mars/mbase/MLog.cc
r7941 r8088 108 108 #include <TGTextView.h> 109 109 110 #include <TEnv.h> // gEnv (ErrorHandler) 111 #include <TError.h> // TError (SetErrorHandler) 112 110 113 #include "MArgs.h" 111 114 #include "MTime.h" … … 113 116 114 117 #include "MLogHtml.h" 118 #include "MLogManip.h" // inf,warn,err (MLog::ErrorHandler) 115 119 116 120 ClassImp(MLog); … … 153 157 void MLog::Init() 154 158 { 155 156 159 // 157 160 // Creat drawing semaphore … … 745 748 return rc; 746 749 } 750 751 // -------------------------------------------------------------------------- 752 // 753 // Check whether errors at this level should be ignored. 754 // 755 bool MLog::ErrorHandlerIgnore(Int_t level) 756 { 757 // The default error handler function. It prints the message on stderr and 758 // if abort is set it aborts the application. 759 if (gErrorIgnoreLevel == kUnset) { 760 R__LOCKGUARD2(gErrorMutex); 761 762 gErrorIgnoreLevel = 0; 763 if (gEnv) { 764 TString level = gEnv->GetValue("Root.ErrorIgnoreLevel", "Info"); 765 if (!level.CompareTo("Info",TString::kIgnoreCase)) 766 gErrorIgnoreLevel = kInfo; 767 else if (!level.CompareTo("Warning",TString::kIgnoreCase)) 768 gErrorIgnoreLevel = kWarning; 769 else if (!level.CompareTo("Error",TString::kIgnoreCase)) 770 gErrorIgnoreLevel = kError; 771 else if (!level.CompareTo("Break",TString::kIgnoreCase)) 772 gErrorIgnoreLevel = kBreak; 773 else if (!level.CompareTo("SysError",TString::kIgnoreCase)) 774 gErrorIgnoreLevel = kSysError; 775 else if (!level.CompareTo("Fatal",TString::kIgnoreCase)) 776 gErrorIgnoreLevel = kFatal; 777 } 778 } 779 780 return level < gErrorIgnoreLevel; 781 } 782 783 // -------------------------------------------------------------------------- 784 // 785 // Output the root error message to the log-stream. 786 // 787 void MLog::ErrorHandlerPrint(Int_t level, const char *location, const char *msg) 788 { 789 R__LOCKGUARD2(gErrorMutex); 790 791 if (level >= kError) 792 gLog << "ROOT:Error"; 793 else 794 if (level >= kSysError) 795 gLog << "SysError"; 796 else 797 if (level >= kBreak) 798 gLog << "\n *** Break ***"; 799 else 800 if (level >= kFatal) 801 gLog << "Fatal"; 802 else 803 if (level >= kWarning) 804 gLog << "ROOT:Warning"; 805 else 806 if (level >= kInfo) 807 gLog << "ROOT:Info"; 808 809 if (level >= kBreak && level < kSysError) 810 gLog << " " << msg << std::endl; 811 else 812 if (!location || strlen(location) == 0) 813 gLog << ": " << msg << std::endl; 814 else 815 gLog << " in <" << location << ">: " << msg << std::endl; 816 } 817 818 // -------------------------------------------------------------------------- 819 // 820 // A new error handler using gLog instead of stderr as output. 821 // It is mainly a copy of root's DefaultErrorHandler 822 // (see TError.h and TError.cxx) 823 // 824 void MLog::ErrorHandlerCol(Int_t level, Bool_t abort, const char *location, const char *msg) 825 { 826 if (ErrorHandlerIgnore(level)) 827 return; 828 829 gLog << std::flush; 830 831 if (level >= kInfo) 832 gLog << inf; 833 if (level >= kWarning) 834 gLog << warn; 835 if (level >= kError) 836 gLog << err; 837 838 ErrorHandlerPrint(level, location, msg); 839 840 gLog << std::flush; 841 if (!abort) 842 return; 843 844 gLog << err << "aborting" << std::endl; 845 if (gSystem) { 846 gSystem->StackTrace(); 847 gSystem->Abort(); 848 } else 849 ::abort(); 850 } 851 852 // -------------------------------------------------------------------------- 853 // 854 // A new error handler using gLog instead of stderr as output. 855 // It is mainly a copy of root's DefaultErrorHandler 856 // (see TError.h and TError.cxx) 857 // 858 void MLog::ErrorHandlerAll(Int_t level, Bool_t abort, const char *location, const char *msg) 859 { 860 if (ErrorHandlerIgnore(level)) 861 return; 862 863 gLog << std::flush << all; 864 865 ErrorHandlerPrint(level, location, msg); 866 867 gLog << std::flush; 868 if (!abort) 869 return; 870 871 gLog << err << "aborting" << std::endl; 872 if (gSystem) { 873 gSystem->StackTrace(); 874 gSystem->Abort(); 875 } else 876 ::abort(); 877 } 878 879 // -------------------------------------------------------------------------- 880 // 881 // Redirect the root ErrorHandler (see TError.h) output to gLog. 882 // 883 // The diffrent types are: 884 // kColor: Use gLog colors 885 // kBlackWhite: Use all-qualifier (as in gLog << all << endl;) 886 // kDefault: Set back to root's default error handler 887 // (redirect output to stderr) 888 // 889 void MLog::RedirectErrorHandler(ELogType typ) 890 { 891 switch (typ) 892 { 893 case kColor: 894 SetErrorHandler(MLog::ErrorHandlerCol); 895 break; 896 case kBlackWhite: 897 SetErrorHandler(MLog::ErrorHandlerAll); 898 break; 899 case kDefault: 900 SetErrorHandler(DefaultErrorHandler); 901 } 902 } -
trunk/MagicSoft/Mars/mbase/MLog.h
r7949 r8088 35 35 enum ELogBits { 36 36 kHasChanged = BIT(14) // if gui has changed 37 }; 38 39 enum ELogType { 40 kDefault, 41 kColor, 42 kBlackWhite 37 43 }; 38 44 … … 95 101 void AddGuiLine(const TString& line); 96 102 103 // User defined error handling (see TError.h) 104 static bool ErrorHandlerIgnore(Int_t level); 105 static void ErrorHandlerPrint(Int_t level, const char *location, const char *msg); 106 static void ErrorHandlerCol(Int_t level, Bool_t abort, const char *location, const char *msg); 107 static void ErrorHandlerAll(Int_t level, Bool_t abort, const char *location, const char *msg); 108 97 109 public: 110 98 111 MLog(int i=eStdout); 99 112 MLog(ofstream &out); … … 110 123 111 124 static TString Intro(); 125 static void RedirectErrorHandler(ELogType typ=kColor); 112 126 113 127 bool LockUpdate(const char *msg); -
trunk/MagicSoft/Mars/merpp.cc
r8011 r8088 150 150 return 0xff; 151 151 152 MLog::RedirectErrorHandler(MLog::kColor); 153 152 154 // 153 155 // Evaluate arguments -
trunk/MagicSoft/Mars/readdaq.cc
r8011 r8088 62 62 return 0xff; 63 63 64 MLog::RedirectErrorHandler(MLog::kColor); 65 64 66 // 65 67 // Evaluate arguments -
trunk/MagicSoft/Mars/readraw.cc
r8011 r8088 72 72 if (!MARS::CheckRootVer()) 73 73 return 0xff; 74 75 MLog::RedirectErrorHandler(MLog::kColor); 74 76 75 77 // Evaluate arguments -
trunk/MagicSoft/Mars/showplot.cc
r8011 r8088 93 93 return 0xff; 94 94 95 MLog::RedirectErrorHandler(MLog::kColor); 96 95 97 // 96 98 // Evaluate arguments -
trunk/MagicSoft/Mars/sinope.cc
r8011 r8088 269 269 return 0xff; 270 270 271 MLog::RedirectErrorHandler(MLog::kColor); 272 271 273 // 272 274 // Evaluate arguments -
trunk/MagicSoft/Mars/star.cc
r8071 r8088 94 94 return 0xff; 95 95 96 MLog::RedirectErrorHandler(MLog::kColor); 97 96 98 // 97 99 // Evaluate arguments
Note:
See TracChangeset
for help on using the changeset viewer.