]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/STEERBase/AliLog.cxx
Update master to aliroot
[u/mrichter/AliRoot.git] / STEER / STEERBase / AliLog.cxx
index cc7523a106a4a484df8c6e1927430308e67cafbe..2af77434b195c2b6367a4c29006b6c40308be511 100644 (file)
 #include <Varargs.h> // platform independent definition of va_copy
 
 #include "AliLog.h"
+// STD
+#include <iostream>
+#include <algorithm>
+#include <sstream>
+#include <stdexcept>
+#include <functional>
+
+
 
 using std::endl;
 using std::cout;
@@ -421,12 +429,16 @@ void AliLog::EnableDebug(Bool_t enabled)
 void AliLog::EnableCoreDump(Bool_t enabled)
 {
 // enable or disable debug output
-
+  gSystem->Exec("ulimit -c unlimited");
   fgCoreEnabled = enabled;
   gSystem->ResetSignal(kSigFloatingException,enabled);
   gSystem->ResetSignal(kSigSegmentationViolation,enabled);
-
-
+  if (enabled) {
+    printf("Core dump enabled\n");
+  }
+  else { 
+    printf("Core dump disabled\n");
+  }
 }
 
 
@@ -1221,3 +1233,17 @@ void AliLog::MakeCoreDump(const char *fout){
     gSystem->Exec(Form("gcore   %d", gSystem->GetPid()));
   }
 }
+
+
+void AliLog::TestException(Int_t level){
+  //
+  // Dummy function to throw exception
+  //
+  printf("AliLog::TestException(%d)\n",level);
+  if (level>0){
+    level--;
+    TestException(level);
+  }else{
+    throw std::runtime_error("Test exception");
+  }
+}