CONFIG_LOG2_ALWAYS_RUNTIME

Always use runtime message creation (v2)

Type: bool

Help

If enabled, runtime method is always used for message creation. Static
creation relies on compiler being able to optimize and remove code
based on information known at compile time. It is recommended to
enable this option when optimization is disabled because some compilers
(seen on arm_cortex_m and x86) were using unrealistic amount of stack
for dead code. Option applies to v1 as well because distinction
between versions is done by the compiler.

Direct dependencies

LOG

(Includes any dependencies from ifs and menus.)

Default

Kconfig definition

At <Zephyr>/subsys/logging/Kconfig.misc:37

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:42<Zephyr>/subsys/Kconfig:31<Zephyr>/subsys/logging/Kconfig:27

Menu path: (Top) → Sub Systems and OS Services → Logging → Misc

config LOG2_ALWAYS_RUNTIME
    bool "Always use runtime message creation (v2)"
    default y if NO_OPTIMIZATIONS
    depends on LOG
    help
      If enabled, runtime method is always used for message creation. Static
      creation relies on compiler being able to optimize and remove code
      based on information known at compile time. It is recommended to
      enable this option when optimization is disabled because some compilers
      (seen on arm_cortex_m and x86) were using unrealistic amount of stack
      for dead code. Option applies to v1 as well because distinction
      between versions is done by the compiler.

(The ‘depends on’ condition includes propagated dependencies from ifs and menus.)