Skip to content

Commit

Permalink
Add debug config option and log token discovery only in debug mode
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Burandt <[email protected]>
  • Loading branch information
cburandt committed Nov 14, 2024
1 parent b889916 commit c5d8fbf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/PN7160TokenProvider/main/auth_token_providerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ void auth_token_providerImpl::new_rfid_token_callback(char* uid, size_t length,
token.id_token.value = rfid_to_string(uid, length);
token.authorization_type = types::authorization::AuthorizationType::RFID;

EVLOG_info << "Publishing new rfid/nfc token: " << token;
if (config.debug) {
EVLOG_info << "Publishing new rfid/nfc token: " << token;
}
this->publish_provided_token(token);

this->last_rfid_submit = now;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace main {
struct Conf {
int token_debounce_interval_ms;

Check notice on line 24 in modules/PN7160TokenProvider/main/auth_token_providerImpl.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/PN7160TokenProvider/main/auth_token_providerImpl.hpp#L24

struct member 'Conf::token_debounce_interval_ms' is never used.
bool disable_nfc_rfid;

Check notice on line 25 in modules/PN7160TokenProvider/main/auth_token_providerImpl.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/PN7160TokenProvider/main/auth_token_providerImpl.hpp#L25

struct member 'Conf::disable_nfc_rfid' is never used.
bool debug;

Check notice on line 26 in modules/PN7160TokenProvider/main/auth_token_providerImpl.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/PN7160TokenProvider/main/auth_token_providerImpl.hpp#L26

struct member 'Conf::debug' is never used.
};

class auth_token_providerImpl : public auth_token_providerImplBase {
Expand Down
4 changes: 4 additions & 0 deletions modules/PN7160TokenProvider/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ provides:
description: Disable NFC RFID reader
type: boolean
default: false
debug:
description: Show debug output on command line.
type: boolean
default: false
metadata:
license: https://opensource.org/licenses/Apache-2.0
authors:
Expand Down

0 comments on commit c5d8fbf

Please sign in to comment.