# HG changeset patch # User Alain Mazy # Date 1581064536 -3600 # Node ID e7248fa2738f82ef392d9ea38d9ba7b7d2f885b2 # Parent 427a130842413d5215742787b87c3b265d3f406d# Parent 468181e2f0902f48d7c782d849c95b60dc75b50d merge diff -r 468181e2f090 -r e7248fa2738f Resources/Samples/CppHelpers/Logging/ILogger.h --- a/Resources/Samples/CppHelpers/Logging/ILogger.h Wed Feb 05 15:23:22 2020 +0100 +++ b/Resources/Samples/CppHelpers/Logging/ILogger.h Fri Feb 07 09:35:36 2020 +0100 @@ -8,6 +8,21 @@ namespace OrthancHelpers { + + inline std::string ShortenId(const std::string& orthancUuid) + { + size_t firstHyphenPos = orthancUuid.find_first_of('-'); + if (firstHyphenPos == std::string::npos) + { + return orthancUuid; + } + else + { + return orthancUuid.substr(0, firstHyphenPos); + } + } + + // Interface for loggers providing the same interface // in Orthanc framework or in an Orthanc plugins. // Furthermore, compared to the LOG and VLOG macros,