Skip to content

Commit f6daa2c

Browse files
committed
Add logging control
Signed-off-by: Sam Friedman <sam@golioth.io>
1 parent 4a0b012 commit f6daa2c

11 files changed

Lines changed: 18 additions & 10 deletions

File tree

Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,12 @@ config POUCH_GATEWAY_SERVER_CERT_BUILTIN
3939
bool
4040
default y if !POUCH_GATEWAY_CLOUD
4141

42+
module = POUCH_GATEWAY
43+
module-str = Pouch Gateway Library
44+
source "subsys/logging/Kconfig.template.log_config"
45+
46+
module = POUCH_GATEWAY_GATT
47+
module-str = Pouch Gateway GATT Library
48+
source "subsys/logging/Kconfig.template.log_config"
49+
4250
endif # POUCH_GATEWAY

lib/bt/cert.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <pouch_gateway/cert.h>
2020

2121
#include <zephyr/logging/log.h>
22-
LOG_MODULE_REGISTER(cert_gatt);
22+
LOG_MODULE_REGISTER(cert_gatt, CONFIG_POUCH_GATEWAY_GATT_LOG_LEVEL);
2323

2424
static void gateway_server_cert_write_start(struct bt_conn *conn);
2525
static void gateway_device_cert_read_start(struct bt_conn *conn);

lib/bt/connect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <pouch_gateway/bt/uplink.h>
2222

2323
#include <zephyr/logging/log.h>
24-
LOG_MODULE_REGISTER(connect);
24+
LOG_MODULE_REGISTER(connect, CONFIG_POUCH_GATEWAY_GATT_LOG_LEVEL);
2525

2626
static const struct bt_uuid_128 golioth_svc_uuid_128 =
2727
BT_UUID_INIT_128(POUCH_GATT_UUID_SVC_VAL_128);

lib/bt/downlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <pouch_gateway/downlink.h>
1919

2020
#include <zephyr/logging/log.h>
21-
LOG_MODULE_REGISTER(downlink_gatt);
21+
LOG_MODULE_REGISTER(downlink_gatt, CONFIG_POUCH_GATEWAY_GATT_LOG_LEVEL);
2222

2323
static void write_response_cb(struct bt_conn *conn,
2424
uint8_t err,

lib/bt/info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <pouch_gateway/bt/info.h>
1313

1414
#include <zephyr/logging/log.h>
15-
LOG_MODULE_REGISTER(info_gatt);
15+
LOG_MODULE_REGISTER(info_gatt, CONFIG_POUCH_GATEWAY_GATT_LOG_LEVEL);
1616

1717
static void info_cleanup(struct bt_conn *conn)
1818
{

lib/bt/scan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <pouch/transport/gatt/common/uuids.h>
1313

1414
#include <zephyr/logging/log.h>
15-
LOG_MODULE_REGISTER(scan);
15+
LOG_MODULE_REGISTER(scan, CONFIG_POUCH_GATEWAY_GATT_LOG_LEVEL);
1616

1717
#include <pouch_gateway/bt/scan.h>
1818

lib/bt/uplink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <pouch_gateway/bt/uplink.h>
2020

2121
#include <zephyr/logging/log.h>
22-
LOG_MODULE_REGISTER(uplink_gatt);
22+
LOG_MODULE_REGISTER(uplink_gatt, CONFIG_POUCH_GATEWAY_GATT_LOG_LEVEL);
2323

2424
static uint8_t handle_uplink_payload(struct bt_conn *conn, const void *data, uint16_t length)
2525
{

lib/cert.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <zephyr/sys/atomic_types.h>
1919

2020
#include <zephyr/logging/log.h>
21-
LOG_MODULE_REGISTER(cert);
21+
LOG_MODULE_REGISTER(cert, CONFIG_POUCH_GATEWAY_LOG_LEVEL);
2222

2323
static struct golioth_client *_client;
2424

lib/downlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <pouch_gateway/downlink.h>
1616

1717
#include <zephyr/logging/log.h>
18-
LOG_MODULE_REGISTER(downlink);
18+
LOG_MODULE_REGISTER(downlink, CONFIG_POUCH_GATEWAY_LOG_LEVEL);
1919

2020
enum
2121
{

lib/info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <cddl/info_decode.h>
1616

1717
#include <zephyr/logging/log.h>
18-
LOG_MODULE_REGISTER(info);
18+
LOG_MODULE_REGISTER(info, CONFIG_POUCH_GATEWAY_LOG_LEVEL);
1919

2020
#define INFO_MAX_SIZE 64
2121

0 commit comments

Comments
 (0)