hooks_log.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this
  5. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  6. #ifndef HOOKS_LOG_H
  7. #define HOOKS_LOG_H
  8. #include <log/macros.h>
  9. #include <hooks/hooks_messages.h>
  10. namespace isc {
  11. namespace hooks {
  12. /// @brief Hooks debug Logging levels
  13. ///
  14. /// Defines the levels used to output debug messages in the Hooks framework.
  15. /// Note that higher numbers equate to more verbose (and detailed) output.
  16. // The first level traces normal operations,
  17. const int HOOKS_DBG_TRACE = DBGLVL_TRACE_BASIC;
  18. // The next level traces each call to hook code.
  19. const int HOOKS_DBG_CALLS = DBGLVL_TRACE_BASIC_DATA;
  20. // Additional information on the calls. Report each call to a callout (even
  21. // if there are multiple callouts on a hook) and each status return.
  22. const int HOOKS_DBG_EXTENDED_CALLS = DBGLVL_TRACE_DETAIL_DATA;
  23. /// @brief Hooks Logger
  24. ///
  25. /// Define the logger used to log messages. We could define it in multiple
  26. /// modules, but defining in a single module and linking to it saves time and
  27. /// space.
  28. extern isc::log::Logger hooks_logger;
  29. /// @brief Callouts logger
  30. ///
  31. /// This is the specialized logger used to log messages pertaining to the
  32. /// callouts execution. In particular, it logs when the callout is invoked
  33. /// and when it ends. It also logs the callout execution times.
  34. extern isc::log::Logger callouts_logger;
  35. } // namespace hooks
  36. } // namespace isc
  37. #endif // HOOKS_LOG_H