mirror of
https://github.com/albfan/miraclecast.git
synced 2025-02-12 16:01:55 +00:00
log wpa messages
This commit is contained in:
parent
6e9402d8a0
commit
0bf42867ad
3 changed files with 15 additions and 1 deletions
|
@ -6,6 +6,8 @@ function _miracle-wifid() {
|
|||
|
||||
case "$prev" in
|
||||
--log-level)
|
||||
COMPREPLY=($(compgen -W '1 2 3 4 5 6 7 8' -- "$cur"))
|
||||
--wpa-loglevel)
|
||||
COMPREPLY=($(compgen -W '1 2 3 4 5 6 7' -- "$cur"))
|
||||
return 0
|
||||
;;
|
||||
|
@ -24,7 +26,7 @@ function _miracle-sinkctl() {
|
|||
|
||||
case "$prev" in
|
||||
--log-level)
|
||||
COMPREPLY=($(compgen -W '1 2 3 4 5 6 7' -- "$cur"))
|
||||
COMPREPLY=($(compgen -W '1 2 3 4 5 6 7 8' -- "$cur"))
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -45,6 +45,9 @@ enum log_severity {
|
|||
#endif
|
||||
#ifndef LOG_DEBUG
|
||||
LOG_DEBUG = 7,
|
||||
#endif
|
||||
#ifndef LOG_TRACE
|
||||
LOG_TRACE = 8,
|
||||
#endif
|
||||
LOG_SEV_NUM,
|
||||
};
|
||||
|
@ -167,9 +170,13 @@ extern const char *LOG_SUBSYSTEM;
|
|||
#ifdef BUILD_ENABLE_DEBUG
|
||||
#define log_debug(format, ...) \
|
||||
log_printf(LOG_DEBUG, (format), ##__VA_ARGS__)
|
||||
#define log_trace(format, ...) \
|
||||
log_printf(LOG_TRACE, (format), ##__VA_ARGS__)
|
||||
#else
|
||||
#define log_debug(format, ...) \
|
||||
log_dummyf(LOG_DEBUG, (format), ##__VA_ARGS__)
|
||||
#define log_trace(format, ...) \
|
||||
log_dummyf(LOG_TRACE, (format), ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#define log_info(format, ...) \
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
* along with MiracleCast; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define LOG_SUBSYSTEM "wpa"
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <inttypes.h>
|
||||
|
@ -33,6 +35,7 @@
|
|||
#include "shl_dlist.h"
|
||||
#include "shl_util.h"
|
||||
#include "wpas.h"
|
||||
#include "shl_log.h"
|
||||
|
||||
#define CTRL_PATH_TEMPLATE "/tmp/.miracle-wpas-%d-%lu"
|
||||
|
||||
|
@ -742,6 +745,8 @@ static int wpas__parse_message(struct wpas *w,
|
|||
int r, num;
|
||||
bool is_event = false;
|
||||
|
||||
log_trace("raw message: %s", raw);
|
||||
|
||||
if ((pos = shl_startswith(raw, "IFNAME="))) {
|
||||
ifname = pos;
|
||||
pos = strchrnul(pos, ' ');
|
||||
|
|
Loading…
Reference in a new issue