HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_LogUtils Class Reference

#include <PDG_LogUtils.h>

Public Types

enum  LogType {
  eLogTypeCache, eLogTypeExpr, eLogTypeNode, eLogTypeScheduler,
  eLogTypeService, eLogTypeWorkItem, eLogTypeTransfer, eLogTypeTypeRegistration,
  eLogTypeCount
}
 
enum  NodeDebug {
  eNodeDebugNone, eNodeDebugStatus, eNodeDebugError, eNodeDebugWarning,
  eNodeDebugCallback
}
 
enum  SchedulerDebug { eSchedulerDebugNone, eSchedulerDebugScheduler, eSchedulerDebugWorkItem }
 
enum  ServiceDebug {
  eServiceDebugNone, eServiceDebugClientUsage, eServiceDebugClientDefer, eServiceDebugStartup,
  eServiceDebugJob
}
 
enum  WorkItemDebug { eWorkItemDebugNone, eWorkItemDebugScheduled, eWorkItemDebugAll }
 
enum  CacheDebug {
  eCacheDebugNone, eCacheDebugMiss, eCacheDebugHit, eCacheDebugId,
  eCacheDebugHandler
}
 
enum  ExpressionDebug { eExprDebugNone, eExprDebugTime, eExprDebugAttrib }
 
enum  TransferDebug {
  eTransferDebugNone, eTransferDebugFailure, eTransferDebugSuccess, eTransferDebugAll,
  eTransferDebugHandler
}
 

Static Public Member Functions

static fpreal currentTime ()
 
static int verbosity ()
 Returns the current verbosity. More...
 
static void setVerbosity (int verbosity)
 Sets the verbosity. More...
 
static bool configureFromEnvironment (bool force)
 
static void enableAll ()
 Enables all logging with the maximum log level for each log type. More...
 
static void disableAll ()
 Disables all logging across all log types. More...
 
template<LogType Type, typename Level , typename... Args>
static void debugLog (Level level, const char *fmt, Args &&...args)
 
template<typename Level >
static Level logLevel (LogType type)
 Returns the log level for the specified log type. More...
 
template<typename Level >
static void setLogLevel (LogType type, Level level)
 Sets the log level for the specified log type. More...
 
static void workItemLog (WorkItemDebug level, UT_ErrorSeverity severity, const PDG_WorkItem *work_item, const UT_StringHolder &tag, fpreal time_stamp)
 Writes a work item output message to stdout. More...
 
static void nodeLog (NodeDebug level, const PDG_Node *node, const UT_StringHolder &tag, const UT_StringHolder &message)
 Writes a verbose node output message to stdout. More...
 
static void schedulerLog (SchedulerDebug level, const PDG_Scheduler *scheduler, const PDG_WorkItem *work_item, const UT_StringHolder &tag, const UT_StringHolder &message)
 Writes a verbose scheduler output message to stdout. More...
 
static void schedulerLog (SchedulerDebug level, const PDG_Scheduler *scheduler, PDG_WorkItemID work_item, const UT_StringHolder &tag, const UT_StringHolder &message)
 
static void serviceLog (ServiceDebug level, PDG_WorkItemID work_item_id, const UT_StringHolder &service_name, const UT_StringHolder &client_name, const UT_StringHolder &tag)
 Writes a service log message to stdout. More...
 
static void typeLog (PDGT_TypeErrorLevel level, const UT_StringHolder &message, const UT_StringHolder &tag)
 Writes a type registration log message to stdout. More...
 
static void writeLog (const UT_StringHolder &source, const UT_StringHolder &message)
 Writes a generic log message to stdout. More...
 

Friends

class pdg_UniversalLogWorkItemStatusSource
 

Detailed Description

Definition at line 30 of file PDG_LogUtils.h.

Member Enumeration Documentation

Enumeration of cache debug log levels

Enumerator
eCacheDebugNone 

No cache logging.

eCacheDebugMiss 

Log cache misses.

eCacheDebugHit 

Log cache misses + hits.

eCacheDebugId 

Log cache misses + hits + cache id changes.

eCacheDebugHandler 

Log cache misses + hits + cache ids + custom handlers.

Definition at line 145 of file PDG_LogUtils.h.

Enumeration of expression debug log levels

Enumerator
eExprDebugNone 

No expression logging.

eExprDebugTime 

Log expressions that are marked as time dependent becaused of attribute references

eExprDebugAttrib 

Log all attribute reference evaluations.

Definition at line 166 of file PDG_LogUtils.h.

Enumeration of log types

Enumerator
eLogTypeCache 

Cache and handler logging.

eLogTypeExpr 

Expression evaluation logging.

eLogTypeNode 

Node status/debug logging.

eLogTypeScheduler 

Scheduler status/debug logging.

eLogTypeService 

Service client status/debug logging.

eLogTypeWorkItem 

Work item status/debug logging.

eLogTypeTransfer 

File transer debug logging.

eLogTypeTypeRegistration 

Type registration errors and warnings.

eLogTypeCount 

Total number of log types, should always be last.

Definition at line 36 of file PDG_LogUtils.h.

Enumeration of node debug log levels

Enumerator
eNodeDebugNone 

No debug logging.

eNodeDebugStatus 

Log node status updates, e.g. generated or cooked.

eNodeDebugError 

Log node status + errors.

eNodeDebugWarning 

Log node status + errors + warnings.

eNodeDebugCallback 

Log node status + errors + warning + callback invocations.

Definition at line 69 of file PDG_LogUtils.h.

Enumeration of scheduler debug log levels

Enumerator
eSchedulerDebugNone 

No debug logging.

eSchedulerDebugScheduler 

Log messages for events that occur at the scheduler level.

eSchedulerDebugWorkItem 

Log messages for events that occur at both the scheduler and work item level

Definition at line 90 of file PDG_LogUtils.h.

Enumeration of service debug log levels

Enumerator
eServiceDebugNone 

No debug logging.

eServiceDebugClientUsage 

Log messages for when a service client is acquired/released.

eServiceDebugClientDefer 

Log messages for when a service client isn't found, in addition to the above

eServiceDebugStartup 

Log messages for when a service starts up or is shutdown, in addition to the above

eServiceDebugJob 

Logs messages for each time a job is a sent to a service client, addition to the above

Definition at line 106 of file PDG_LogUtils.h.

Emumeration of file trasfer debug log levels

Enumerator
eTransferDebugNone 

No file transfer debug logging.

eTransferDebugFailure 

Log only failed file transfers.

eTransferDebugSuccess 

Log failed and successful file transfers, but skip logging for transfers that were cached/not performed

eTransferDebugAll 

Log failed, successful, and skipped transfers.

eTransferDebugHandler 

Log all transfer outcomes, as well as custom handler results.

Definition at line 182 of file PDG_LogUtils.h.

Enumeration of work item log levels

Enumerator
eWorkItemDebugNone 

No work item logging.

eWorkItemDebugScheduled 

Work item status updates for scheduled work items.

eWorkItemDebugAll 

Work item status updates for all work items.

Definition at line 130 of file PDG_LogUtils.h.

Member Function Documentation

static bool PDG_LogUtils::configureFromEnvironment ( bool  force)
static

Sets the log level variables from the environment. If custom log levels have been set using setLogLevel(..), then this method only makes change if force=true. Returns true if the log levels were updated, else false.

static fpreal PDG_LogUtils::currentTime ( )
static

Returns the current time stamp as a floating point value. This is different than calling SYStime() because it's adjusted to be relative to the unix epoch, rather than an aribtrary value that isn't cross platform. It's also different than just calling time(nullptr) because it still includes milliseconds like SYStime().

template<LogType Type, typename Level , typename... Args>
static void PDG_LogUtils::debugLog ( Level  level,
const char *  fmt,
Args &&...  args 
)
inlinestatic

Writes a typed logged message to stdout, assuming the log level is set appropriately

Definition at line 236 of file PDG_LogUtils.h.

static void PDG_LogUtils::disableAll ( )
static

Disables all logging across all log types.

static void PDG_LogUtils::enableAll ( )
static

Enables all logging with the maximum log level for each log type.

template<typename Level >
static Level PDG_LogUtils::logLevel ( LogType  type)
inlinestatic

Returns the log level for the specified log type.

Definition at line 253 of file PDG_LogUtils.h.

static void PDG_LogUtils::nodeLog ( NodeDebug  level,
const PDG_Node node,
const UT_StringHolder tag,
const UT_StringHolder message 
)
static

Writes a verbose node output message to stdout.

static void PDG_LogUtils::schedulerLog ( SchedulerDebug  level,
const PDG_Scheduler scheduler,
const PDG_WorkItem work_item,
const UT_StringHolder tag,
const UT_StringHolder message 
)
static

Writes a verbose scheduler output message to stdout.

static void PDG_LogUtils::schedulerLog ( SchedulerDebug  level,
const PDG_Scheduler scheduler,
PDG_WorkItemID  work_item,
const UT_StringHolder tag,
const UT_StringHolder message 
)
static

Writes a verbose scheduler output message to stdout, including a work item ID

static void PDG_LogUtils::serviceLog ( ServiceDebug  level,
PDG_WorkItemID  work_item_id,
const UT_StringHolder service_name,
const UT_StringHolder client_name,
const UT_StringHolder tag 
)
static

Writes a service log message to stdout.

template<typename Level >
static void PDG_LogUtils::setLogLevel ( LogType  type,
Level  level 
)
inlinestatic

Sets the log level for the specified log type.

Definition at line 261 of file PDG_LogUtils.h.

static void PDG_LogUtils::setVerbosity ( int  verbosity)
inlinestatic

Sets the verbosity.

Definition at line 215 of file PDG_LogUtils.h.

static void PDG_LogUtils::typeLog ( PDGT_TypeErrorLevel  level,
const UT_StringHolder message,
const UT_StringHolder tag 
)
static

Writes a type registration log message to stdout.

static int PDG_LogUtils::verbosity ( )
inlinestatic

Returns the current verbosity.

Definition at line 211 of file PDG_LogUtils.h.

static void PDG_LogUtils::workItemLog ( WorkItemDebug  level,
UT_ErrorSeverity  severity,
const PDG_WorkItem work_item,
const UT_StringHolder tag,
fpreal  time_stamp 
)
static

Writes a work item output message to stdout.

static void PDG_LogUtils::writeLog ( const UT_StringHolder source,
const UT_StringHolder message 
)
static

Writes a generic log message to stdout.

Friends And Related Function Documentation

friend class pdg_UniversalLogWorkItemStatusSource
friend

Definition at line 324 of file PDG_LogUtils.h.


The documentation for this class was generated from the following file: