Options.hpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 __DIAGLOG_OPTIONS_HPP_
  9. #define __DIAGLOG_OPTIONS_HPP_
  10. #include <string>
  11. #include "DlSystem/ZdlExportDefine.hpp"
  12. namespace zdl
  13. {
  14. namespace DiagLog
  15. {
  16. /** @addtogroup c_plus_plus_apis C++
  17. @{ */
  18. /// @brief .
  19. ///
  20. /// Options for setting up diagnostic logging for zdl components.
  21. class ZDL_EXPORT Options
  22. {
  23. public:
  24. Options() :
  25. DiagLogMask(""),
  26. LogFileDirectory("diaglogs"),
  27. LogFileName("DiagLog"),
  28. LogFileRotateCount(20),
  29. LogFileReplace(true)
  30. {
  31. // Solves the empty string problem with multiple std libs
  32. DiagLogMask.reserve(1);
  33. }
  34. /// @brief .
  35. ///
  36. /// Enables diag logging only on the specified area mask (DNN_RUNTIME=ON | OFF)
  37. std::string DiagLogMask;
  38. /// @brief .
  39. ///
  40. /// The path to the directory where log files will be written.
  41. /// The path may be relative or absolute. Relative paths are interpreted
  42. /// from the current working directory.
  43. /// Default value is "diaglogs"
  44. std::string LogFileDirectory;
  45. /// @brief .
  46. ///
  47. //// The name used for log files. If this value is empty then BaseName will be
  48. /// used as the default file name.
  49. /// Default value is "DiagLog"
  50. std::string LogFileName;
  51. /// @brief .
  52. ///
  53. /// The maximum number of log files to create. If set to 0 no log rotation
  54. /// will be used and the log file name specified will be used each time, overwriting
  55. /// any existing log file that may exist.
  56. /// Default value is 20
  57. uint32_t LogFileRotateCount;
  58. /// @brief
  59. ///
  60. /// If the log file already exists, control whether it will be replaced
  61. /// (existing contents truncated), or appended.
  62. /// Default value is true
  63. bool LogFileReplace;
  64. };
  65. /** @} */ /* end_addtogroup c_plus_plus_apis C++ */
  66. } // DiagLog namespace
  67. } // zdl namespace
  68. #endif