00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "G4AnalysisVerbose.hh"
00031 #include "G4UnitsTable.hh"
00032
00033 #include <iostream>
00034
00035
00036 G4AnalysisVerbose::G4AnalysisVerbose(const G4String& type, G4int verboseLevel)
00037 : fType(type),
00038 fToBeDoneText(),
00039 fDoneText(),
00040 fFailureText()
00041 {
00042 if ( verboseLevel == 1 ) fDoneText = "- done";
00043 if ( verboseLevel == 2 ) fDoneText = "- done";
00044 if ( verboseLevel == 3 ) fToBeDoneText = "done ";
00045 if ( verboseLevel == 4 ) fToBeDoneText = "going to ";
00046 fFailureText = "has failed";
00047 }
00048
00049
00050 G4AnalysisVerbose::~G4AnalysisVerbose()
00051 {
00052 }
00053
00054
00055
00056
00057
00058
00059 void G4AnalysisVerbose::Message(const G4String& action,
00060 const G4String& object,
00061 const G4String& objectName,
00062 G4bool success)
00063 {
00064 G4cout << "... "
00065 << fToBeDoneText
00066 << action
00067 << " "
00068 << fType
00069 << " "
00070 << object
00071 << " : "
00072 << objectName
00073 << " ";
00074
00075 if ( success )
00076 G4cout << fDoneText;
00077 else
00078 G4cout << fFailureText;
00079
00080 G4cout << G4endl;
00081 }
00082
00083
00084 void G4AnalysisVerbose::Message(const G4String& action,
00085 const G4String& object,
00086 G4ExceptionDescription& description,
00087 G4bool success)
00088 {
00089 G4cout << "... "
00090 << fToBeDoneText
00091 << action
00092 << " "
00093 << fType
00094 << " "
00095 << object
00096 << " : "
00097 << description.str()
00098 << " ";
00099
00100 if ( success )
00101 G4cout << fDoneText;
00102 else
00103 G4cout << fFailureText;
00104
00105 G4cout << G4endl;
00106 }
00107