Skip to content

Commit 8ce4996

Browse files
maass-hamburgkartben
authored andcommitted
logging: backend: net: avoid automatic enabling
Avoid automatic enabling of the syslog backend by the logging subsystem. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
1 parent 03c557b commit 8ce4996

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

subsys/logging/backends/log_backend_net.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,18 @@ static void panic(struct log_backend const *const backend)
338338
panic_mode = true;
339339
}
340340

341+
/* After initialization of the logger, this function avoids
342+
* the logger subsys to enable it.
343+
*/
344+
static int backend_ready(const struct log_backend *const backend)
345+
{
346+
return log_backend_is_active(backend) ? 0 : -EAGAIN;
347+
}
348+
341349
const struct log_backend_api log_backend_net_api = {
342350
.panic = panic,
343351
.init = init_net,
352+
.is_ready = backend_ready,
344353
.process = process,
345354
.format_set = format_set,
346355
};

0 commit comments

Comments
 (0)