add: more debug logging
This commit is contained in:
parent
d4ba7177d1
commit
a37bdc4870
7 changed files with 13 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required (VERSION 3.7)
|
||||
project(controller
|
||||
VERSION 0.2.9
|
||||
VERSION 0.2.10
|
||||
LANGUAGES C)
|
||||
|
||||
add_executable(controller src/main.c)
|
||||
|
|
|
@ -32,6 +32,8 @@ controller_load(MDB_env *mdb_env)
|
|||
|
||||
controller_t *new_controller;
|
||||
|
||||
LOGGER_DEBUG("loading controller\n");
|
||||
|
||||
if((err = mdb_txn_begin(mdb_env, NULL, MDB_RDONLY, &mdb_txn)) != 0)
|
||||
{
|
||||
LOGGER_ERR("mdb_txn_begin error %s\n", mdb_strerror(err));
|
||||
|
|
|
@ -34,6 +34,8 @@ controller_save(controller_t *controller, MDB_env *mdb_env)
|
|||
MDB_dbi mdb_dbi;
|
||||
MDB_val value;
|
||||
|
||||
LOGGER_DEBUG("saving controller\n");
|
||||
|
||||
if((err = mdb_txn_begin(mdb_env, NULL, 0, &mdb_txn)) != 0)
|
||||
{
|
||||
LOGGER_ERR("mdb_txn_begin error %s\n", mdb_strerror(err));
|
||||
|
|
|
@ -43,6 +43,8 @@ relay_load(MDB_env *mdb_env, uint8_t num)
|
|||
|
||||
relay_t *new_relay;
|
||||
|
||||
LOGGER_DEBUG("loading relay %d\n", num);
|
||||
|
||||
if((err = mdb_txn_begin(mdb_env, NULL, MDB_RDONLY, &mdb_txn)) != 0)
|
||||
{
|
||||
LOGGER_ERR("mdb_txn_begin error %s\n", mdb_strerror(err));
|
||||
|
|
|
@ -43,6 +43,8 @@ relay_save(relay_t *relay, MDB_env *mdb_env)
|
|||
MDB_dbi mdb_dbi;
|
||||
MDB_val value;
|
||||
|
||||
LOGGER_DEBUG("saving relay %d\n", relay->number);
|
||||
|
||||
if((err = mdb_txn_begin(mdb_env, NULL, 0, &mdb_txn)) != 0)
|
||||
{
|
||||
LOGGER_ERR("mdb_txn_begin error %s\n", mdb_strerror(err));
|
||||
|
|
|
@ -49,6 +49,8 @@ schedule_load(MDB_env *mdb_env, uint8_t relay_num, uint8_t weekday)
|
|||
memset(off_id, 0, sizeof(uuid_t));
|
||||
memcpy(off_id, "off", 3);
|
||||
|
||||
LOGGER_DEBUG("loading schedule %d for relay %d\n", weekday, relay_num);
|
||||
|
||||
if((err = mdb_txn_begin(mdb_env, NULL, MDB_RDONLY, &mdb_txn)) != 0)
|
||||
{
|
||||
LOGGER_ERR("mdb_txn_begin error %s\n", mdb_strerror(err));
|
||||
|
|
|
@ -48,6 +48,8 @@ schedule_save(schedule_t *schedule, uint8_t relay_num, MDB_env *mdb_env)
|
|||
MDB_dbi mdb_dbi;
|
||||
MDB_val value;
|
||||
|
||||
LOGGER_DEBUG("saving schedule %d for relay %d\n", schedule->weekday, relay_num);
|
||||
|
||||
if((err = mdb_txn_begin(mdb_env, NULL, 0, &mdb_txn)) != 0)
|
||||
{
|
||||
LOGGER_ERR("mdb_txn_begin error %s\n", mdb_strerror(err));
|
||||
|
|
Loading…
Reference in a new issue