IDiagLog.hpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //=============================================================================
  2. //
  3. // Copyright (c) 2015, 2020 Qualcomm Technologies, Inc.
  4. // All Rights Reserved.
  5. // Confidential and Proprietary - Qualcomm Technologies, Inc.
  6. //
  7. //=============================================================================
  8. #ifndef __IDIAGLOG_HPP_
  9. #define __IDIAGLOG_HPP_
  10. #include <string>
  11. #include "DiagLog/Options.hpp"
  12. #include "DlSystem/String.hpp"
  13. #include "DlSystem/ZdlExportDefine.hpp"
  14. namespace zdl
  15. {
  16. namespace DiagLog
  17. {
  18. /** @addtogroup c_plus_plus_apis C++
  19. @{ */
  20. /// @brief .
  21. ///
  22. /// Interface for controlling logging for zdl components.
  23. class ZDL_EXPORT IDiagLog
  24. {
  25. public:
  26. /// @brief .
  27. ///
  28. /// Sets the options after initialization occurs.
  29. ///
  30. /// @param[in] loggingOptions The options to set up diagnostic logging.
  31. ///
  32. /// @return False if the options could not be set. Ensure logging is not started.
  33. virtual bool setOptions(const Options& loggingOptions) = 0;
  34. /// @brief .
  35. ///
  36. /// Gets the curent options for the diag logger.
  37. ///
  38. /// @return Diag log options object.
  39. virtual Options getOptions() = 0;
  40. /// @brief .
  41. ///
  42. /// Allows for setting the log mask once diag logging has started
  43. ///
  44. /// @return True if the level was set successfully, false if a failure occurred.
  45. virtual bool setDiagLogMask(const std::string& mask) = 0;
  46. /// @brief .
  47. ///
  48. /// Allows for setting the log mask once diag logging has started
  49. ///
  50. /// @return True if the level was set successfully, false if a failure occurred.
  51. virtual bool setDiagLogMask(const zdl::DlSystem::String& mask) = 0;
  52. /// @brief .
  53. ///
  54. /// Enables logging for zdl components.
  55. ///
  56. /// Logging should be started prior to the instantiation of zdl components
  57. /// to ensure all events are captured.
  58. ///
  59. /// @return False if diagnostic logging could not be started.
  60. virtual bool start(void) = 0;
  61. /// @brief Disables logging for zdl components.
  62. virtual bool stop(void) = 0;
  63. virtual ~IDiagLog() {};
  64. };
  65. } // DiagLog namespace
  66. } // zdl namespace
  67. /** @} */ /* end_addtogroup c_plus_plus_apis C++ */
  68. #endif