log_frontend.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright (c) 2019 Nordic Semiconductor ASA
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef LOG_FRONTEND_H_
  7. #define LOG_FRONTEND_H_
  8. #include <logging/log_core.h>
  9. /** @brief Initialize frontend.
  10. */
  11. void log_frontend_init(void);
  12. /** @brief Standard log with no arguments.
  13. *
  14. * @param str String.
  15. * @param src_level Log identification.
  16. */
  17. void log_frontend_0(const char *str, struct log_msg_ids src_level);
  18. /** @brief Standard log with one argument.
  19. *
  20. * @param str String.
  21. * @param arg0 First argument.
  22. * @param src_level Log identification.
  23. */
  24. void log_frontend_1(const char *str,
  25. log_arg_t arg0,
  26. struct log_msg_ids src_level);
  27. /** @brief Standard log with two arguments.
  28. *
  29. * @param str String.
  30. * @param arg0 First argument.
  31. * @param arg1 Second argument.
  32. * @param src_level Log identification.
  33. */
  34. void log_frontend_2(const char *str,
  35. log_arg_t arg0,
  36. log_arg_t arg1,
  37. struct log_msg_ids src_level);
  38. /** @brief Standard log with three arguments.
  39. *
  40. * @param str String.
  41. * @param arg0 First argument.
  42. * @param arg1 Second argument.
  43. * @param arg2 Third argument.
  44. * @param src_level Log identification.
  45. */
  46. void log_frontend_3(const char *str,
  47. log_arg_t arg0,
  48. log_arg_t arg1,
  49. log_arg_t arg2,
  50. struct log_msg_ids src_level);
  51. /** @brief Standard log with arguments list.
  52. *
  53. * @param str String.
  54. * @param args Array with arguments.
  55. * @param narg Number of arguments in the array.
  56. * @param src_level Log identification.
  57. */
  58. void log_frontend_n(const char *str,
  59. log_arg_t *args,
  60. uint32_t narg,
  61. struct log_msg_ids src_level);
  62. /** @brief Hexdump log.
  63. *
  64. * @param str String.
  65. * @param data Data.
  66. * @param length Data length.
  67. * @param src_level Log identification.
  68. */
  69. void log_frontend_hexdump(const char *str,
  70. const uint8_t *data,
  71. uint32_t length,
  72. struct log_msg_ids src_level);
  73. #endif /* LOG_FRONTEND_H_ */