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