diff options
author | Richard van der Hoff <richard@matrix.org> | 2016-04-26 11:44:32 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2016-04-26 17:55:26 +0100 |
commit | 9848f8445292ad3f7ff92bd4abfeb8f2d08ec32d (patch) | |
tree | 36f1f030f71bd16b85e0fe1aa77c42f457a3b168 /src/account.cpp | |
parent | e7a2af1ede768589e612bad1c61b10186a1bb686 (diff) |
Add some logging to help understand what's going on
Diffstat (limited to 'src/account.cpp')
-rw-r--r-- | src/account.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/account.cpp b/src/account.cpp index 43033c8..4fca953 100644 --- a/src/account.cpp +++ b/src/account.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015 OpenMarket Ltd +/* Copyright 2015, 2016 OpenMarket Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,12 @@ */ #include "olm/account.hh" #include "olm/base64.hh" +#include "olm/logging.hh" #include "olm/pickle.hh" #include "olm/memory.hh" +static const char *LOG_CATEGORY = "olm::Account"; + olm::Account::Account( ) : next_one_time_key_id(0), last_error(olm::ErrorCode::SUCCESS) { @@ -42,9 +45,11 @@ std::size_t olm::Account::remove_key( if (olm::array_equal(i->key.public_key, public_key.public_key)) { std::uint32_t id = i->id; one_time_keys.erase(i); + olm::logf(olm::LOG_INFO, LOG_CATEGORY, "removed key id %i", id); return id; } } + olm::logf(olm::LOG_WARNING, LOG_CATEGORY, "Couldn't find key to remove"); return std::size_t(-1); } @@ -64,6 +69,8 @@ std::size_t olm::Account::new_account( random += KEY_LENGTH; olm::curve25519_generate_key(random, identity_keys.curve25519_key); + olm::logf(olm::LOG_DEBUG, LOG_CATEGORY, "Created new account"); + return 0; } |