Changeset 2784 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 01/13/04 15:41:12 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
r2617 r2784 5 5 #pragma link off all functions; 6 6 7 // Global constants 7 8 #pragma link C++ enum ParticleId_t; 8 9 … … 11 12 //#pragma link C++ global kPI; 12 13 14 // Logging 13 15 #pragma link C++ global gLog; 14 16 15 17 #pragma link C++ class MLog+; 18 #pragma link C++ class MLogPlugin+; 19 #pragma link C++ class MLogHtml+; 20 21 // Basic Network Tools 16 22 #pragma link C++ class MReadSocket+; 17 23 24 // Basic Tools 18 25 #pragma link C++ class MIter+; 19 26 #pragma link C++ class MAstro+; 20 27 #pragma link C++ class MDirIter+; 28 29 // Mars core 30 #pragma link C++ class MInputStreamID+; 31 32 #pragma link C++ class MParContainer+; 33 #pragma link C++ class MParList+; 21 34 22 35 #pragma link C++ class MTask+; … … 24 37 #pragma link C++ class MTaskList+; 25 38 26 #pragma link C++ class MParContainer+;27 #pragma link C++ class MParList+;28 29 39 #pragma link C++ class MFilter+; 30 40 31 41 #pragma link C++ class MEvtLoop+; 32 42 43 // Mars core (GUI part) 33 44 #pragma link C++ class MStatusDisplay+; 34 45 #pragma link C++ class MProgressBar+; 35 46 #pragma link C++ class MSearch+; 36 37 #pragma link C++ class MInputStreamID+;38 47 39 48 #pragma link C++ class MGTask+; … … 41 50 #pragma link C++ class MGGroupFrame+; 42 51 43 #pragma link C++ class MClone+; 44 #pragma link C++ class MPrint+; 45 #pragma link C++ class MContinue+; 46 52 // Basic containers 47 53 #pragma link C++ class MArray; 48 54 #pragma link C++ class MArrayB; … … 55 61 #pragma link C++ class MArgsEntry+; 56 62 63 // Tool tasks 64 #pragma link C++ class MClone+; 65 #pragma link C++ class MPrint+; 66 #pragma link C++ class MContinue+; 67 57 68 #endif -
trunk/MagicSoft/Mars/mbase/MLog.cc
r2772 r2784 100 100 #include <iomanip> 101 101 102 #include <TROOT.h> // gROOT->GetListOfCleanups() 103 102 104 #ifdef _REENTRANT 103 105 #include <TMutex.h> 104 106 #endif 105 107 #include <TGTextView.h> 108 109 #include "MLogPlugin.h" 106 110 107 111 ClassImp(MLog); … … 140 144 void MLog::Init() 141 145 { 142 setp(&fBuffer, &fBuffer+1); 143 *this << '\0'; 144 145 #ifdef _REENTRANT 146 146 147 // 147 148 // Creat drawing semaphore 148 149 // 150 #ifdef _REENTRANT 149 151 fMuxGui = new TMutex; 150 152 #endif 153 154 fPlugins = new TList; 155 gROOT->GetListOfCleanups()->Add(fPlugins); 156 157 setp(&fBuffer, &fBuffer+1); 158 *this << '\0'; 151 159 } 152 160 … … 202 210 { 203 211 DeallocateFile(); 212 213 delete fPlugins; 204 214 #ifdef _REENTRANT 205 215 delete fMuxGui; … … 223 233 { 224 234 SetBit(kIsUnderlined); 235 236 fPlugins->ForEach(MLogPlugin, Underline)(); 225 237 226 238 if (TestBit(eNoColors)) … … 311 323 fOut->write(fBase, len); 312 324 325 fPlugins->ForEach(MLogPlugin, SetColor)(fOutputLevel); 326 fPlugins->ForEach(MLogPlugin, WriteBuffer)(fBase, len); 327 313 328 if (fDevice&eGui && fGui) 314 329 { … … 490 505 flag ? EnableOutputDevice(chk) : DisableOutputDevice(chk); 491 506 } 507 508 // -------------------------------------------------------------------------- 509 // 510 // Add a plugin to which the output should be redirected, eg. MLogHtml 511 // The user has to take care of its deletion. If the plugin is deleted 512 // (and the kMustCleanup bit was not reset accidentaly) the plugin 513 // is automatically removed from the list of active plugins. 514 // 515 void MLog::AddPlugin(MLogPlugin *plug) 516 { 517 fPlugins->Add(plug); 518 plug->SetBit(kMustCleanup); 519 } -
trunk/MagicSoft/Mars/mbase/MLog.h
r2519 r2784 15 15 class TMutex; 16 16 class TGTextView; 17 18 class MLogPlugin; 17 19 18 20 class MLog : public std::streambuf, public std::ostream, public TObject … … 71 73 #endif 72 74 75 TList *fPlugins; 76 73 77 void Init(); 74 78 … … 192 196 } 193 197 198 void AddPlugin(MLogPlugin *plug); 199 194 200 ClassDef(MLog, 0) // This is what we call 'The logging system' 195 201 }; -
trunk/MagicSoft/Mars/mbase/Makefile
r2604 r2784 34 34 35 35 SRCFILES = MLogo.cc \ 36 MLog.cc \37 36 MArgs.cc \ 38 37 MAstro.cc \ 39 MParContainer.cc \ 38 MLog.cc \ 39 MLogManip.cc \ 40 MLogPlugin.cc \ 41 MLogHtml.cc \ 42 MParContainer.cc \ 40 43 MParList.cc \ 41 44 MInputStreamID.cc \ … … 62 65 MClone.cc \ 63 66 MContinue.cc \ 64 MPrint.cc \ 65 MLogManip.cc 67 MPrint.cc 66 68 67 69 SRCS = $(SRCFILES)
Note:
See TracChangeset
for help on using the changeset viewer.