Logging Discussion
This issue is to collect discussion on goals for logging. This issue will be broken apart into workable issues/tasks as needs are pinned down.
ParaView is considering a move to loguru
, so we should see if that meets our needs. It sounds promising -- lightweight and feature-rich:
https://github.com/emilk/loguru/
Suggested log levels:
// namespace vtkm::log:
enum Level : loguru::Verbosity
{
// Standard loguru levels:
// Unhandled exceptions
Fatal = loguru::Verbosity_FATAL,
// Handled but worrysome exceptions, e.g. device fail-over
Error = loguru::Verbosity_ERROR,
// Good-to-know-but-not-urgent bad news,
// e.g. out-of-bounds parameters clamped to valid range.
Warn = loguru::Verbosity_WARNING,
// General debugging information
// (detected hardware, temp use during development/debugging, etc)
Info = loguru::Verbosity_INFO,
// 1-255: Available for application use:
UserFirst = 1,
UserLast = 255,
// VTK-m specific levels
// Timing data, first since it's most likely to be wanted by people mucking with loggers.
// Filter/worklet execution times, DeviceAdapterAlgorithm calls
Perf,
// Host-side resource allocations/frees (e.g. ArrayHandle control buffers)
MemCont,
// Device-side resource allocations/frees (e.g ArrayHandle device buffers)
MemExec,
// host->device / device->host data copies
MemTransfer,
// Communcation info, e.g. MPI interaction
Comm,
// When a dynamic object is (or isn't) resolved, log the result
CastAndCall,
// 1024-2047 more verbose application levels
UserVerboseFirst = 1024,
UserVerboseLast = 2047
}
Desired loguru modifications:
-
Fix scope RAII move ctor -
Fix locally. -
Merge upstream (https://github.com/emilk/loguru/pull/78)
-
-
Add export macros -
Fix locally. -
Merge upstream (https://github.com/emilk/loguru/pull/79)
-
-
Increase scope timer precision. -
Fix locally. -
Merge upstream (https://github.com/emilk/loguru/pull/80)
-
-
Print log level names in output (instead of integers) -
Runtime registration (Can be exposed to applications) -
Truncate if needed to keep preamble fixed size / easily parsable -
Allow -v
verbosity option parsing to take a string. -
Merge upstream.
-
-
Template class to get readable classnames ( loguru::demangle(typeid(T).name())
should do it) -
More readable array sizes (2.5 GB instead of XXXXXXXX bytes) -
Compile time option to strip out all logging statements (strip by default)
Edited by Allison Vacanti