Browse Source

Init logging with yeclite

pull/25/head^2
Arjun 5 years ago
committed by Aditya Kulkarni
parent
commit
6520a09e6d
  1. 2
      lib/Cargo.toml
  2. 9
      lib/src/lib.rs
  3. 2
      src/controller.cpp
  4. 2
      src/settings.h

2
lib/Cargo.toml

@ -11,4 +11,4 @@ crate-type = ["staticlib"]
[dependencies]
libc = "0.2.58"
lazy_static = "1.4.0"
zecwalletlitelib = { git = "https://github.com/adityapk00/zecwallet-light-cli", rev = "61dc063fe155d1510e9a074e5a3577a0621f8c3a" }
zecwalletlitelib = { git = "https://github.com/adityapk00/zecwallet-light-cli", rev = "96997c5a467b710286bc9c6fea818b9d7d76f254" }

9
lib/src/lib.rs

@ -57,6 +57,9 @@ pub extern fn litelib_initialize_new(dangerous: bool, server: *const c_char) ->
}
};
// Initialize logging
let _ = lightclient.init_logging();
let seed = match lightclient.do_seed_phrase() {
Ok(s) => s.dump(),
Err(e) => {
@ -105,6 +108,9 @@ pub extern fn litelib_initialize_new_from_phrase(dangerous: bool, server: *const
}
};
// Initialize logging
let _ = lightclient.init_logging();
LIGHTCLIENT.lock().unwrap().replace(Some(Arc::new(lightclient)));
let c_str = CString::new("OK").unwrap();
@ -137,6 +143,9 @@ pub extern fn litelib_initialize_existing(dangerous: bool, server: *const c_char
}
};
// Initialize logging
let _ = lightclient.init_logging();
LIGHTCLIENT.lock().unwrap().replace(Some(Arc::new(lightclient)));
let c_str = CString::new("OK").unwrap();

2
src/controller.cpp

@ -169,6 +169,8 @@ void Controller::getInfoThenRefresh(bool force) {
bool doUpdate = force || (model->getLatestBlock() != curBlock);
model->setLatestBlock(curBlock);
main->logger->write(QString("Refresh. curblock ") % QString::number(curBlock) % ", update=" % (doUpdate ? "true" : "false") );
// Connected, so display checkmark.
auto tooltip = Settings::getInstance()->getSettings().server + "\n" +
QString::fromStdString(zrpc->getConnection()->getInfo().dump());

2
src/settings.h

@ -99,7 +99,7 @@ public:
static const QString labelRegExp;
static const int updateSpeed = 60 * 1000; // 60 sec
static const int updateSpeed = 30 * 1000; // 30 sec
static const int priceRefreshSpeed = 60 * 60 * 1000; // 1 hr
private:

Loading…
Cancel
Save