Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions core/base/src/TErrorDefaultHandler.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ void ReleaseDefaultErrorHandler()
} // ROOT namespace


/// Print debugging message to stderr and, on Windows, to the system debugger.
static void DebugPrint(const char *fmt, ...)
/// Print debugging message to outstream (stdout or stderr) and, on Windows, to the system debugger.
static void DebugPrint(FILE *outstream, const char *fmt, ...)
{
TTHREAD_TLS(Int_t) buf_size = 2048;
TTHREAD_TLS(char*) buf = nullptr;
Expand Down Expand Up @@ -86,19 +86,21 @@ static void DebugPrint(const char *fmt, ...)
std::lock_guard<std::mutex> guard(*GetErrorMutex());

const char *toprint = buf; // Work around for older platform where we use TThreadTLSWrapper
fprintf(stderr, "%s", toprint);
fprintf(outstream, "%s", toprint);

#ifdef WIN32
::OutputDebugString(buf);
#endif
}


/// The default error handler function. It prints the message on stderr and
/// if abort is set it aborts the application. Replaces the minimal error handler
/// of TError.h as part of the gROOT construction. TError's minimal handler is put
/// The default error handler function. It prints the message and
/// if abort is set it aborts the application. Replaces the minimal error handler
/// of TError.h as part of the gROOT construction. TError's minimal handler is put
/// back in place during the gROOT destruction.
/// @note `abort()` is only called if `abort_bool` is `true` and `level < gErrorIgnoreLevel`
/// The error message is printed to stdout if the error level is lower than kWarning
/// and to stderr if it's equal or higher; see TError.h.
/// @note `abort()` is only called if `abort_bool` is `true` and `level >= gErrorIgnoreLevel`
void DefaultErrorHandler(Int_t level, Bool_t abort_bool, const char *location, const char *msg)
{
if (gErrorIgnoreLevel == kUnset) {
Expand Down Expand Up @@ -160,18 +162,19 @@ void DefaultErrorHandler(Int_t level, Bool_t abort_bool, const char *location, c
else
smsg = std::string(type) + " in <" + location + ">: " + msg;

DebugPrint("%s\n", smsg.c_str());
auto outstream = level >= gErrorStreamLevel ? stderr : stdout;
DebugPrint(outstream, "%s\n", smsg.c_str());

fflush(stderr);
fflush(outstream);
if (abort_bool) {

#ifdef __APPLE__
if (__crashreporter_info__)
delete [] __crashreporter_info__;
__crashreporter_info__ = strdup(smsg.c_str());
#endif

DebugPrint("aborting\n");
// Since we abort, here we force stderr independently of the level
DebugPrint(stderr, "aborting\n");
fflush(stderr);
if (gSystem) {
gSystem->StackTrace();
Expand Down
1 change: 1 addition & 0 deletions core/foundation/inc/TError.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ R__EXTERN const char *kCheckMsg;
::Warning("", kCheckMsg, _QUOTE_(e), __LINE__, __FILE__); \
} while (false)

R__EXTERN Int_t gErrorStreamLevel; ///< errors with level below this value will be streamed to `stdout`, if greater or equal, to `stderr`. Default is `kWarning`.
R__EXTERN Int_t gErrorIgnoreLevel;
R__EXTERN Int_t gErrorAbortLevel;
R__EXTERN Bool_t gPrintViaErrorHandler;
Expand Down
1 change: 1 addition & 0 deletions core/foundation/src/TError.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ to be replaced by the proper DefaultErrorHandler()
#include <cerrno>
#include <string>

Int_t gErrorStreamLevel = kWarning;
Int_t gErrorIgnoreLevel = kUnset;
Int_t gErrorAbortLevel = kSysError+1;
Bool_t gPrintViaErrorHandler = kFALSE;
Expand Down
3 changes: 1 addition & 2 deletions roottest/python/JupyROOT/ROOT_kernel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@
},
"outputs": [
{
"name": "stderr",
"name": "stdout",
"output_type": "stream",
"text": [
"Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/danilopiparo/RootDevel/Root6/head/roottest/python/JupyROOT/fa9a055b_C.so\n"
]
}
],
Expand Down
3 changes: 1 addition & 2 deletions roottest/python/JupyROOT/simpleCppMagic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@
},
"outputs": [
{
"name": "stderr",
"name": "stdout",
"output_type": "stream",
"text": [
"Info in <TUnixSystem::ACLiC>: creating shared library /home/etejedor/devel/master/roottest/python/JupyROOT/d74d5882_C.so\n"
]
}
],
Expand Down
3 changes: 1 addition & 2 deletions roottest/python/JupyROOT/thread_local.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
"metadata": {},
"outputs": [
{
"name": "stderr",
"name": "stdout",
"output_type": "stream",
"text": [
"Info in <TUnixSystem::ACLiC>: creating shared library /home/dpiparo/RootDevel/Root6/head/build/ddcf9c12_C.so\n"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion roottest/root/dataframe/test_progressiveCSV.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ ROOTDEBUG=1 ./$TESTNAME 1>${TESTNAME}.out 2>${TESTNAME}.err

# Print only messages about lines being read from CSV file
cat ${TESTNAME}.out | grep "Total num lines"
cat ${TESTNAME}.err | grep "GetEntryRanges"
cat ${TESTNAME}.out | grep "GetEntryRanges"

2 changes: 1 addition & 1 deletion roottest/root/io/directory/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ROOTTEST_ADD_TEST(assertCycleParsing
ROOTTEST_ADD_TEST(assertSubdirAndTree
MACRO assertSubdirAndTree.C
COPY_TO_BUILDDIR Collision12-ANNPID.root
ERRREF assertSubdirAndTree.ref)
OUTREF assertSubdirAndTree.ref)

ROOTTEST_ADD_TEST(cd
MACRO runcd.C
Expand Down
1 change: 0 additions & 1 deletion roottest/root/io/directory/assertSubdirAndTree.ref
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
3 changes: 2 additions & 1 deletion roottest/root/multicore/ttree_read_imt.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "ROOT/TThreadExecutor.hxx"
#include "TBranch.h"
#include "TError.h"
#include "TFile.h"
#include "TROOT.h"
#include "TSystem.h"
Expand Down Expand Up @@ -82,7 +83,7 @@ Int_t ReadTree(TTree *tree, Int_t nentries, bool reuse)


int main(int argc, char** argv) {

gErrorStreamLevel = kUnset;
auto options = parseOptions(argc, argv);

const int nthreads = std::get<0>(options);
Expand Down
2 changes: 1 addition & 1 deletion roottest/root/tree/addresses/memleak.ref
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Processing runmemleak.C+...
*Baskets : 2 : Basket Size= 32000 bytes Compression= 77.22 *
*............................................................................*
Info in <memleak>: branch has 2 entries
Executing TMyData::~TMyData()
Info in <memleak>: fSmoothMonoM->IsOwner(): 1
Info in <memleak>: fSmoothMonoM->par(caff)->fSmoothL->IsOwner(): 1
Info in <memleak>: fSmoothMonoM->par(corchg2)->fSmoothL->IsOwner(): 1
Expand Down Expand Up @@ -170,4 +171,3 @@ Executing TMyData::~TMyData()
Executing TMyData::~TMyData()
Executing TMyData::~TMyData()
Executing TMyData::~TMyData()
Executing TMyData::~TMyData()
33 changes: 0 additions & 33 deletions roottest/root/tree/cache/assertTooSmall.eref
Original file line number Diff line number Diff line change
@@ -1,33 +0,0 @@
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t2.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Info in <TTreePerfStats::SaveAs>: ROOT file t1.root has been created
Loading
Loading