thank you for pointing out another two levels that I didn’t noticed: kPrint and kBreak. However, how can I use them? The Print() function defined in TObject is quit different from Info(), Fatal(), etc. and I cannot find anything like Break().
use SysError() for any errors coming from system calls, like fopen(), read(), etc. Use Error() for your own errors and yes, Fatal() will abort the program.
You point out another two levels that I didn’t noticed: kPrint and kBreak. However, how can I use them? The Print() function defined in TObject is quit different from Info(), Fatal(), etc. and I cannot find anything like Break().
See $ROOTSYS/inc/TError.h. There is a Break() function which is not accessible from the interpreter which is only used via the ROOT errorhandler. There is no Print() function but a Printf() function which uses the kPrint flag. Using Printf() as opposed to printf() allows you to also silence or easily redirect all “normal” messages.
Printf() does not accept location as the others do. I have the following levels in mind:
debug - debug info. Normal users don’t want to see them
routine - messages showing the progress of the program or tell users to do something
warning - program can still run, but users have to check something
error - program can still run, but users cannot get what they want anymore
fatal - program can not run anymore
and it would be good if the functions can pick up locations automatically so that the programmer can concentrate on the messages.
In ROOT, Info() is similar to routine, Warning() is like warning, Error() is like error, Fatal() is like fatal in my mind. But there is nothing like debug.
My question is how can I realize a system as the one in my mind based on the existing error handling functions in ROOT?
Is it possible to choose more than one option out of all verbosity? Say, I want to choose kError and kWarning but not others. If possible, how to write inside the code?
I have tried
gErrorIgnoreLevel = kError, kWarning;
if I choose only kPrint, I see this error message :
Error: Symbol kPrint is not defined in current scope