/** * @file * * @author Max Lammers * @author Mamadou Babaei * * @section LICENSE * * Copyright (c) 2020 - 2025 SenseGlove * * @section DESCRIPTION * * Diagnostics class used to send messages to developers from the Sense Glove * API. */ #pragma once #include #include #include #include "Platform.hpp" namespace SGCore { namespace Diagnostics { /// Used to manage incoming debug levels enum class SGCORE_API EDebugLevel : uint8_t { /// No debug messages will be sent. Disabled = 0, /// Send only messages if errors are caught. ErrorsOnly, /// Send messages from calibration algorithms CallibrationMessages, /// Send messages from device Parsing. DeviceParsing, /// Send messages related to backed communications. Mostly relevant when using /// Ports / Android Strings. BackendCommunication, /// Which haptics are eventually sent to the glove Haptics_Sent, /// Which haptics are added into our queue. Haptics_Queue, /// For those we have no place for yet. All, }; /// Used to send Debug Messages to the developer (and user). class Debugger; }// namespace Diagnostics }// namespace SGCore /// Used to send Debug Messages to the developer (and user). class SGCORE_API SGCore::Diagnostics::Debugger { public: /// The Default debug level for any application. static EDebugLevel GetDefaultLevel();// defined separately so we can say debugLevel = default /// The current debug level of the Debugger. static EDebugLevel GetDebugLevel(); static void SetDebugLevel(EDebugLevel level); /// Print a single message with an end-line to the console. static void Log(const std::string& msg, EDebugLevel level); private: struct Impl; public: Debugger() = delete; virtual ~Debugger() = delete; };