int AliHLTComponent::Init(const AliHLTAnalysisEnvironment* comenv, void* environParam, int argc, const char** argv )
{
// see header file for function documentation
- HLTLogKeyword(GetComponentID());
+ HLTLogKeyword(fChainId.c_str());
int iResult=0;
if (comenv) {
memset(&fEnvironment, 0, sizeof(AliHLTAnalysisEnvironment));
if (argument.IsNull()) continue;
// benchmark
- if (argument.CompareTo("benchmark")==0) {
+ if (argument.CompareTo("-benchmark")==0) {
- // loglevel
- } else if (argument.CompareTo("loglevel")==0) {
- if ((bMissingParam=(++i>=argc))) break;
- TString parameter(argv[i]);
+ // -loglevel=
+ } else if (argument.BeginsWith("-loglevel=")) {
+ TString parameter=argument.ReplaceAll("-loglevel=", "");
parameter.Remove(TString::kLeading, ' '); // remove all blanks
if (parameter.BeginsWith("0x") &&
parameter.Replace(0,2,"",0).IsHex()) {
int AliHLTComponent::Deinit()
{
// see header file for function documentation
- HLTLogKeyword(GetComponentID());
+ HLTLogKeyword(fChainId.c_str());
int iResult=0;
iResult=DoDeinit();
if (fpRunDesc) {
AliHLTComponentEventDoneData*& edd )
{
// see header file for function documentation
- HLTLogKeyword(GetComponentID());
+ HLTLogKeyword(fChainId.c_str());
ALIHLTCOMPONENT_BASE_STOPWATCH();
int iResult=0;
fCurrentEvent=evtData.fEventID;
* @section alihlt_component_arguments Default arguments
* The component base class provides some default arguments:
* <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ * \li -loglevel=level <br>
* \li -object-compression=level <br>
* compression level for ROOT objects, default is defined by
* @ref ALIHLTCOMPONENT_DEFAULT_OBJECT_COMPRESSION
AliHLTLogging::AliHLTLogging()
:
- //fLocalLogFilter(kHLTLogDefault),
- fLocalLogFilter(kHLTLogAll),
+ fLocalLogFilter(fgLocalLogDefault),
fpDefaultKeyword(NULL),
fpCurrentKeyword(NULL)
{
ostringstream AliHLTLogging::fgLogstr;
AliHLTComponentLogSeverity AliHLTLogging::fgGlobalLogFilter=kHLTLogAll;
+AliHLTComponentLogSeverity AliHLTLogging::fgLocalLogDefault=kHLTLogAll;
AliHLTfctLogging AliHLTLogging::fgLoggingFunc=NULL;
AliHLTLogging::AliHLTDynamicMessage AliHLTLogging::fgAliLoggingFunc=NULL;
int AliHLTLogging::fgUseAliLog=1;
return fLocalLogFilter;
}
+void AliHLTLogging::SetLocalLoggingDefault(AliHLTComponentLogSeverity level)
+{
+ // see header file for class documentation
+ fgLocalLogDefault=level;
+}
+
int AliHLTLogging::CheckGroup(const char* /*originClass*/) const
{
// see header file for class documentation
#define HLT_DEFAULT_LOG_KEYWORD "no key"
+/**
+ * @class AliHLTLogging
+ * Basic logging class. All classes inherit the besic HLT logging functionality.
+ * Logging levels are controlled by a global logging filter and a local logging
+ * filter.
+ *
+ * @section alihlt_logging_levels Logging Levels
+ * Logging levels are switched by a bit pattern, AliHLTComponentLogSeverity {
+ * - ::kHLTLogNone no logging (0)
+ * - ::kHLTLogBenchmark benchmark messages (0x1)
+ * - ::kHLTLogDebug debug messages (0x2)
+ * - ::kHLTLogInfo info messages (0x4)
+ * - ::kHLTLogWarning warning messages (0x8)
+ * - ::kHLTLogError error messages (0x10)
+ * - ::kHLTLogFatal fatal error messages (0x20)
+ * - ::kHLTLogImportant few important messages not to be filtered out (0x40)
+ * - ::kHLTLogAll special value to enable all messages (0x7f)
+ * - ::kHLTLogDefault the default logging level: Warning, Error, Fatal, Important (0x79)
+ *
+ * @section alihlt_logging_filter Logging Filters
+ * The class provides a global and a local logging filter, the AND beween both
+ * defines whether a message is printed or not.
+ *
+ * The global filter is by default set to ::kHLTLogAll. Please note that AliHLTSystem
+ * changes the global logging level to ::kHLTLogDefault. The global filter can be
+ * adjusted by means of SetGlobalLoggingLevel().
+ *
+ * The local filter is set to ::kHLTLogAll and can be adjusted by
+ * SetLocalLoggingLevel(). The default can be changed for all objects by
+ * SetLocalLoggingDefault(). Please note that a change of the default level only
+ * applies to objects generated after the change of the default.
+ *
+ * @section alihlt_logging_external Redirection
+ * - external logging function
+ * - keyword
+ *
+ * @section alihlt_logging_aliroot AliRoot Redirection
+ * - switching of redirection
+ * - logging options in AliSimulation/AliReconstruction
+ *
+ * @ingroup alihlt_component
+ */
class AliHLTLogging {
public:
AliHLTLogging();
*/
virtual void SetLocalLoggingLevel(AliHLTComponentLogSeverity level);
+ /**
+ * Set local logging default
+ * Default logging filter for individual objects.
+ */
+ static void SetLocalLoggingDefault(AliHLTComponentLogSeverity level);
+
/**
* Get local logging level
* logging filter for individual object
static AliHLTComponentLogSeverity fgGlobalLogFilter; // see above
/** the local logging filter for one class */
AliHLTComponentLogSeverity fLocalLogFilter; // see above
+ /** the global logging filter */
+ static AliHLTComponentLogSeverity fgLocalLogDefault; // see above
/** logging callback from the framework */
static AliHLTfctLogging fgLoggingFunc; // see above
/** default keyword */