logging: Log warning and drop too big message
When packacge exceeds the limitation warning log is printed and message is dropped. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
24ad096232
commit
a5979dcfa1
1 changed files with 6 additions and 4 deletions
|
|
@ -63,10 +63,12 @@ void z_impl_z_log_msg_static_create(const void *source,
|
|||
NULL, 0, flags,
|
||||
strl, ARRAY_SIZE(strl));
|
||||
|
||||
if (len > Z_LOG_MSG_MAX_PACKAGE)
|
||||
{
|
||||
LOG_WRN("Log message dropped because it exceeds current limitation (%u)",
|
||||
(uint32_t)Z_LOG_MSG_MAX_PACKAGE);
|
||||
if (len > Z_LOG_MSG_MAX_PACKAGE) {
|
||||
struct cbprintf_package_hdr_ext *pkg =
|
||||
(struct cbprintf_package_hdr_ext *)package;
|
||||
|
||||
LOG_WRN("Message (\"%s\") dropped because it exceeds size limitation (%u)",
|
||||
pkg->fmt, (uint32_t)Z_LOG_MSG_MAX_PACKAGE);
|
||||
return;
|
||||
}
|
||||
/* Update package length with calculated value (which may be extended
|
||||
|
|
|
|||
Loading…
Reference in a new issue