Commit e1b4250c authored by Allison Vacanti's avatar Allison Vacanti Committed by Kitware Robot
Browse files

Merge topic 'loguru_fixups'

6fb879ec Fix typo in logging docs.
be0db4b0

 Add parameter-less InitLogging().
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: default avatarRobert Maynard <robert.maynard@kitware.com>
Merge-request: !1431
parents 16c4dde2 6fb879ec
......@@ -129,6 +129,14 @@ void InitLogging(int& argc, char* argv[])
#endif // VTKM_ENABLE_LOGGING
}
void InitLogging()
{
int argc = 1;
char dummy[1] = { '\0' };
char* argv[2] = { dummy, nullptr };
InitLogging(argc, argv);
}
VTKM_CONT
void SetStderrLogLevel(LogLevel level)
{
......
......@@ -159,7 +159,7 @@
///
/// \code
/// {
/// VTKM_LOG_SCOPE(vtkm::cont::Perf,
/// VTKM_LOG_SCOPE(vtkm::cont::LogLevel::Perf,
/// "Executing filter %s",
/// vtkm::cont::TypeName(myFilter).c_str());
/// myFilter.Execute();
......@@ -321,10 +321,21 @@ enum class LogLevel
* Initializes logging. Sets up custom log level and thread names. Parses any
* "-v [LogLevel]" arguments to set the stderr log level. This argument may
* be either numeric, or the 4-character string printed in the output.
*
* If the parameterless overload is used, the `-v` parsing is not used, but
* other functionality should still work.
*
* @note This function is not threadsafe and should only be called from a single
* thread (ideally the main thread).
* @{
*/
VTKM_CONT_EXPORT
VTKM_CONT
void InitLogging(int& argc, char* argv[]);
VTKM_CONT_EXPORT
VTKM_CONT
void InitLogging();
/**@}*/
/**
* Set the range of log levels that will be printed to stderr. All levels
......
......@@ -82,12 +82,11 @@ void RunTests()
} // end anon namespace
int UnitTestLogging(int argc, char* argv[])
int UnitTestLogging(int, char* [])
{
vtkm::cont::InitLogging(argc, argv);
vtkm::cont::SetLogThreadName("main thread");
// Test that parameterless init works:
vtkm::cont::InitLogging();
// return vtkm::cont::testing::Testing::Run(RunTests);
RunTests();
return 0;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment