Sven Eckelmann | 7db7d9f | 2017-11-19 15:05:11 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Sven Eckelmann | cfa55c6 | 2021-01-01 00:00:01 +0100 | [diff] [blame] | 2 | /* Copyright (C) B.A.T.M.A.N. contributors: |
Sven Eckelmann | ba41208 | 2016-05-15 23:48:31 +0200 | [diff] [blame] | 3 | * |
| 4 | * Marek Lindner |
Sven Eckelmann | ba41208 | 2016-05-15 23:48:31 +0200 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include "log.h" |
| 8 | #include "main.h" |
| 9 | |
Alexey Dobriyan | c0891ac | 2021-08-02 23:40:32 +0300 | [diff] [blame] | 10 | #include <linux/stdarg.h> |
Sven Eckelmann | ba41208 | 2016-05-15 23:48:31 +0200 | [diff] [blame] | 11 | |
Sven Eckelmann | d331a73 | 2018-08-10 23:36:16 +0200 | [diff] [blame] | 12 | #include "trace.h" |
Sven Eckelmann | 00caf6a | 2018-08-10 23:36:15 +0200 | [diff] [blame] | 13 | |
Sven Eckelmann | 0dacc7fa | 2018-10-21 11:30:31 +0200 | [diff] [blame] | 14 | /** |
| 15 | * batadv_debug_log() - Add debug log entry |
| 16 | * @bat_priv: the bat priv with all the soft interface information |
| 17 | * @fmt: format string |
| 18 | * |
| 19 | * Return: 0 on success or negative error number in case of failure |
| 20 | */ |
| 21 | int batadv_debug_log(struct batadv_priv *bat_priv, const char *fmt, ...) |
| 22 | { |
| 23 | struct va_format vaf; |
| 24 | va_list args; |
| 25 | |
| 26 | va_start(args, fmt); |
| 27 | |
| 28 | vaf.fmt = fmt; |
| 29 | vaf.va = &args; |
| 30 | |
Sven Eckelmann | 0dacc7fa | 2018-10-21 11:30:31 +0200 | [diff] [blame] | 31 | trace_batadv_dbg(bat_priv, &vaf); |
| 32 | |
| 33 | va_end(args); |
| 34 | |
| 35 | return 0; |
| 36 | } |