feat: v1.0.3, log
This commit is contained in:
2
justfile
2
justfile
@@ -10,3 +10,5 @@ lint:
|
||||
build:
|
||||
cargo build --release
|
||||
|
||||
build-linux-musl-server:
|
||||
cargo build --release --target=x86_64-unknown-linux-musl --no-default-features
|
||||
|
||||
10
src/db.rs
10
src/db.rs
@@ -1,5 +1,5 @@
|
||||
use rusqlite::{Connection, params};
|
||||
use rust_util::{debugging, information, opt_result, simple_error, success, XResult};
|
||||
use rusqlite::{params, Connection};
|
||||
use rust_util::{opt_result, simple_error, XResult};
|
||||
|
||||
pub const DEFAULT_MASTER_KEY_VERIFICATION_KEY: &str = "__master_verification_key";
|
||||
|
||||
@@ -15,7 +15,7 @@ pub fn make_db_key_name(name: &str) -> String {
|
||||
|
||||
pub fn open_db(db: &str) -> XResult<Connection> {
|
||||
let con = opt_result!(Connection::open(db), "Open sqlite db: {}, failed: {}", db);
|
||||
debugging!("Db auto commit: {}", con.is_autocommit());
|
||||
log::debug!("Db auto commit: {}", con.is_autocommit());
|
||||
Ok(con)
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ pub fn init_db(conn: &Connection) -> XResult<bool> {
|
||||
"SELECT name FROM sqlite_master WHERE type='table' AND name='keys'")?;
|
||||
let mut rows = stmt.query(())?;
|
||||
if rows.next()?.is_some() {
|
||||
information!("Table keys exists, skip init");
|
||||
log::info!("Table keys exists, skip init");
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ pub fn init_db(conn: &Connection) -> XResult<bool> {
|
||||
comment TEXT
|
||||
)
|
||||
"##, ())?;
|
||||
success!("Table keys created");
|
||||
log::info!("Table keys created");
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user