MIDI2LR 6.1.0.0
MIDI2LR is an application that interfaces MIDI controllers with Lightroom 6+/CC Classic. It processes MIDI input into develop parameter updates and photo actions, and sends MIDI output when parameters are changed for motorized feedback (on controllers that have motorized faders). A listing of available LightRoom commands is in the Wiki. Assistance on the code and design is welcome.
Loading...
Searching...
No Matches
DebugInfo Class Reference

#include <DebugInfo.h>

Public Member Functions

 DebugInfo (std::string_view profile_directory) noexcept
 
const std::vector< std::string > & GetInfo () const noexcept
 

Private Member Functions

void LogAndSave (std::string &&msg)
 

Private Attributes

std::vector< std::string > info_
 

Constructor & Destructor Documentation

◆ DebugInfo()

DebugInfo::DebugInfo ( std::string_view  profile_directory)
explicitnoexcept
272{
273 try {
274 LogAndSave(fmt::format(FMT_STRING("Application: System language {}."),
275 juce::SystemStats::getDisplayLanguage().toStdString()));
276 LogAndSave(fmt::format(FMT_STRING("Application: CPU {}."),
277 juce::SystemStats::getCpuModel().toStdString()));
278 // ReSharper disable CppUnreachableCode
279 if constexpr (kNdebug) {
280 LogAndSave(fmt::format(FMT_STRING("Application: Application version {}."),
281 ProjectInfo::versionString));
282 }
283 else {
284 LogAndSave(fmt::format(FMT_STRING("Application: Application version {}-debug."),
285 ProjectInfo::versionString));
286 }
287 // ReSharper restore CppUnreachableCode
288 LogAndSave(fmt::format(FMT_STRING("Application: Application path {}."),
289 juce::File::getSpecialLocation(juce::File::currentApplicationFile)
290 .getFullPathName()
291 .toStdString()));
292 LogAndSave(fmt::format(FMT_STRING("Application: Profile directory {}."), profile_directory));
293 LogAndSave(fmt::format(FMT_STRING("Application: Log file directory {}."),
294 ww898::utf::conv<char>(rsj::AppLogFilePath(MIDI2LR_UC_LITERAL("")))));
295 LogAndSave(fmt::format(FMT_STRING("Application: Settings file directory {}."),
296 ww898::utf::conv<char>(rsj::AppDataFilePath(MIDI2LR_UC_LITERAL("")))));
297#ifdef _WIN32
298 /* MacOS defers keyboard layout information until first keystroke sent */
299 LogAndSave(fmt::format(FMT_STRING("Application: Keyboard type {}."), GetKeyboardLayout()));
300#endif
301 LogAndSave(fmt::format(FMT_STRING("Juce version {}."),
302 juce::SystemStats::getJUCEVersion().toStdString()));
303 }
304 catch (...) {
305 try {
306 static constexpr auto kErr {"Failed to obtain app info. Exception."};
307 info_.emplace_back(kErr);
308 rsj::Log(kErr);
309 }
310 catch (...) { //-V565 //-V5002 // NOLINT(bugprone-empty-catch)
311 }
312 }
313}
std::vector< std::string > info_
Definition DebugInfo.h:38
void LogAndSave(std::string &&msg)
Definition DebugInfo.h:32
std::string AppLogFilePath(const std::string &file_name)
std::string AppDataFilePath(const std::string &file_name)
void Log(const juce::String &info, const std::source_location &location=std::source_location::current()) noexcept
Definition Misc.cpp:131

Member Function Documentation

◆ GetInfo()

const std::vector< std::string > & DebugInfo::GetInfo ( ) const
inlinenoexcept
29{ return info_; }

◆ LogAndSave()

void DebugInfo::LogAndSave ( std::string &&  msg)
inlineprivate
33 {
34 rsj::Log(msg);
35 info_.push_back(std::move(msg));
36 }

Member Data Documentation

◆ info_

std::vector<std::string> DebugInfo::info_
private

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