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

Member Function Documentation

◆ GetInfo()

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

◆ LogAndSave()

void DebugInfo::LogAndSave ( std::string && msg)
inlineprivate
33 {
34 rsj::Log(msg, std::source_location::current());
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:
  • C:/Users/rsjaf/source/repos/MIDI2LR/src/application/DebugInfo.h
  • C:/Users/rsjaf/source/repos/MIDI2LR/src/application/DebugInfo.cpp