pw_log: Explicitly pass verbosity to PW_LOG

Updates the PW_LOG contract to ensure that PW_LOG's default
implementation does not rely on any global preprocessor defines,
instead it ensures that all arguments are explicitly passed. This
is done by passing the verbosity explicitly as an argument by
selecting them in the PW_LOG_* macros instead and updating the
PW_LOG_ENABLE_IF to also take in verbosity.

Lastly PW_LOG_ENABLE_IF_DEFAULT is removed and PW_LOG_ENABLE_IF is
changed to be a module configuration option, meaning that there
should be a single definition for a toolchain (this is not permitted
to vary between compile units).

Change-Id: Idef3483e1aa173295f85b18f4971b2891abb9b25
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/239035
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ben Lawson <benlawson@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
11 files changed
tree: df03d91ca593e32e52dbad4e327636b23bb43c7c
  1. .allstar/
  2. .github/
  3. .vscode/
  4. build_overrides/
  5. docker/
  6. docs/
  7. kudzu/
  8. pw_alignment/
  9. pw_allocator/
  10. pw_analog/
  11. pw_android_toolchain/
  12. pw_arduino_build/
  13. pw_assert/
  14. pw_assert_basic/
  15. pw_assert_fuchsia/
  16. pw_assert_log/
  17. pw_assert_tokenized/
  18. pw_assert_trap/
  19. pw_assert_zephyr/
  20. pw_async/
  21. pw_async2/
  22. pw_async2_basic/
  23. pw_async2_epoll/
  24. pw_async_basic/
  25. pw_async_fuchsia/
  26. pw_base64/
  27. pw_bloat/
  28. pw_blob_store/
  29. pw_bluetooth/
  30. pw_bluetooth_hci/
  31. pw_bluetooth_profiles/
  32. pw_bluetooth_proxy/
  33. pw_bluetooth_sapphire/
  34. pw_boot/
  35. pw_boot_cortex_m/
  36. pw_build/
  37. pw_build_android/
  38. pw_build_info/
  39. pw_build_mcuxpresso/
  40. pw_bytes/
  41. pw_channel/
  42. pw_checksum/
  43. pw_chre/
  44. pw_chrono/
  45. pw_chrono_embos/
  46. pw_chrono_freertos/
  47. pw_chrono_rp2040/
  48. pw_chrono_stl/
  49. pw_chrono_threadx/
  50. pw_chrono_zephyr/
  51. pw_cli/
  52. pw_cli_analytics/
  53. pw_clock_tree/
  54. pw_clock_tree_mcuxpresso/
  55. pw_compilation_testing/
  56. pw_config_loader/
  57. pw_console/
  58. pw_containers/
  59. pw_cpu_exception/
  60. pw_cpu_exception_cortex_m/
  61. pw_cpu_exception_risc_v/
  62. pw_crypto/
  63. pw_digital_io/
  64. pw_digital_io_linux/
  65. pw_digital_io_mcuxpresso/
  66. pw_digital_io_rp2040/
  67. pw_display/
  68. pw_dma_mcuxpresso/
  69. pw_docgen/
  70. pw_doctor/
  71. pw_emu/
  72. pw_env_setup/
  73. pw_env_setup_zephyr/
  74. pw_file/
  75. pw_format/
  76. pw_function/
  77. pw_fuzzer/
  78. pw_grpc/
  79. pw_hdlc/
  80. pw_hex_dump/
  81. pw_i2c/
  82. pw_i2c_linux/
  83. pw_i2c_mcuxpresso/
  84. pw_i2c_rp2040/
  85. pw_ide/
  86. pw_interrupt/
  87. pw_interrupt_cortex_m/
  88. pw_interrupt_xtensa/
  89. pw_interrupt_zephyr/
  90. pw_intrusive_ptr/
  91. pw_json/
  92. pw_kvs/
  93. pw_libc/
  94. pw_libcxx/
  95. pw_log/
  96. pw_log_android/
  97. pw_log_basic/
  98. pw_log_fuchsia/
  99. pw_log_null/
  100. pw_log_rpc/
  101. pw_log_string/
  102. pw_log_tokenized/
  103. pw_log_zephyr/
  104. pw_malloc/
  105. pw_malloc_freelist/
  106. pw_malloc_freertos/
  107. pw_metric/
  108. pw_minimal_cpp_stdlib/
  109. pw_module/
  110. pw_multibuf/
  111. pw_multisink/
  112. pw_numeric/
  113. pw_package/
  114. pw_perf_test/
  115. pw_persistent_ram/
  116. pw_polyfill/
  117. pw_preprocessor/
  118. pw_presubmit/
  119. pw_protobuf/
  120. pw_protobuf_compiler/
  121. pw_random/
  122. pw_random_fuchsia/
  123. pw_result/
  124. pw_ring_buffer/
  125. pw_router/
  126. pw_rpc/
  127. pw_rpc_transport/
  128. pw_rust/
  129. pw_sensor/
  130. pw_snapshot/
  131. pw_software_update/
  132. pw_span/
  133. pw_spi/
  134. pw_spi_linux/
  135. pw_spi_mcuxpresso/
  136. pw_spi_rp2040/
  137. pw_status/
  138. pw_stm32cube_build/
  139. pw_stream/
  140. pw_stream_shmem_mcuxpresso/
  141. pw_stream_uart_linux/
  142. pw_stream_uart_mcuxpresso/
  143. pw_string/
  144. pw_symbolizer/
  145. pw_sync/
  146. pw_sync_baremetal/
  147. pw_sync_embos/
  148. pw_sync_freertos/
  149. pw_sync_stl/
  150. pw_sync_threadx/
  151. pw_sync_zephyr/
  152. pw_sys_io/
  153. pw_sys_io_ambiq_sdk/
  154. pw_sys_io_arduino/
  155. pw_sys_io_baremetal_lm3s6965evb/
  156. pw_sys_io_baremetal_stm32f429/
  157. pw_sys_io_emcraft_sf2/
  158. pw_sys_io_mcuxpresso/
  159. pw_sys_io_rp2040/
  160. pw_sys_io_stdio/
  161. pw_sys_io_stm32cube/
  162. pw_sys_io_zephyr/
  163. pw_system/
  164. pw_target_runner/
  165. pw_thread/
  166. pw_thread_embos/
  167. pw_thread_freertos/
  168. pw_thread_stl/
  169. pw_thread_threadx/
  170. pw_thread_zephyr/
  171. pw_tls_client/
  172. pw_tls_client_boringssl/
  173. pw_tls_client_mbedtls/
  174. pw_tokenizer/
  175. pw_toolchain/
  176. pw_toolchain_bazel/
  177. pw_trace/
  178. pw_trace_tokenized/
  179. pw_transfer/
  180. pw_uart/
  181. pw_uart_mcuxpresso/
  182. pw_unit_test/
  183. pw_unit_test_zephyr/
  184. pw_varint/
  185. pw_watch/
  186. pw_web/
  187. pw_work_queue/
  188. seed/
  189. targets/
  190. third_party/
  191. ts/
  192. zephyr/
  193. .bazelignore
  194. .bazelrc
  195. .bazelversion
  196. .black.toml
  197. .clang-format
  198. .clang-tidy
  199. .eslintrc.cjs
  200. .git-blame-ignore-revs
  201. .gitattributes
  202. .gitignore
  203. .gn
  204. .mypy.ini
  205. .prettierignore
  206. .prettierrc.cjs
  207. .pw_ide.yaml
  208. .pylintrc
  209. .ruff.toml
  210. activate.bat
  211. Android.bp
  212. AUTHORS
  213. bootstrap.bat
  214. bootstrap.fish
  215. bootstrap.sh
  216. BUILD.bazel
  217. BUILD.gn
  218. BUILDCONFIG.gn
  219. CMakeLists.txt
  220. go.mod
  221. go.sum
  222. jest.config.ts
  223. Kconfig.zephyr
  224. LICENSE
  225. MODULE.bazel
  226. MODULE.bazel.lock
  227. modules.gni
  228. OWNERS
  229. package-lock.json
  230. package.json
  231. pigweed.json
  232. PIGWEED_MODULES
  233. README.md
  234. rollup.config.js
  235. tsconfig.json
  236. WORKSPACE
  237. WORKSPACE_OWNERS
README.md

Pigweed

Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.

For more information please see our website: https://pigweed.dev/.

Links