Unify dependencies

This commit is contained in:
Adrian Woźniak 2021-08-13 12:56:11 +02:00
parent 477a888a12
commit dc5164f779
No known key found for this signature in database
GPG Key ID: DE43476F72AD3F6C
18 changed files with 47 additions and 84 deletions

21
Cargo.lock generated
View File

@ -892,6 +892,9 @@ dependencies = [
"actix-web",
"actix-web-actors",
"actix_derive 0.6.0",
"env_logger",
"log",
"pretty_env_logger",
"reexport-proc-macro",
"serde",
"serde_derive",
@ -1034,20 +1037,17 @@ dependencies = [
"derive_db_execute",
"diesel",
"dotenv",
"env_logger",
"futures",
"ipnetwork 0.16.0",
"jirs-config",
"jirs-data",
"libc",
"log",
"num-bigint",
"num-integer",
"num-traits",
"openssl-sys",
"percent-encoding",
"pq-sys",
"pretty_env_logger",
"r2d2",
"serde",
"time 0.1.44",
@ -1362,11 +1362,8 @@ dependencies = [
"actix-files",
"bytes 0.5.6",
"common",
"env_logger",
"futures",
"jirs-config",
"log",
"pretty_env_logger",
"tokio",
]
@ -1689,13 +1686,10 @@ dependencies = [
"actix 0.10.0",
"bincode",
"common",
"env_logger",
"flate2",
"jirs-config",
"jirs-data",
"lazy_static",
"log",
"pretty_env_logger",
"serde",
"simsearch",
"syntect",
@ -2133,15 +2127,12 @@ dependencies = [
"actix 0.10.0",
"common",
"dotenv",
"env_logger",
"futures",
"jirs-config",
"lettre",
"lettre_email",
"libc",
"log",
"openssl-sys",
"pretty_env_logger",
"serde",
"toml",
"uuid 0.8.2",
@ -4226,16 +4217,13 @@ dependencies = [
"bytes 0.5.6",
"common",
"database-actor",
"env_logger",
"filesystem-actor",
"futures",
"jirs-config",
"jirs-data",
"libc",
"log",
"mail-actor",
"openssl-sys",
"pretty_env_logger",
"serde",
"tokio",
"toml",
@ -4262,7 +4250,6 @@ dependencies = [
"common",
"comrak",
"database-actor",
"env_logger",
"flate2",
"futures",
"highlight-actor",
@ -4270,10 +4257,8 @@ dependencies = [
"jirs-data",
"lazy_static",
"libc",
"log",
"mail-actor",
"openssl-sys",
"pretty_env_logger",
"pulldown-cmark",
"serde",
"syntect",

View File

@ -42,10 +42,6 @@ num-integer = { version = "0.1.32" }
bigdecimal = { version = ">= 0.0.10, <= 0.1.0" }
bitflags = { version = "1.0" }
log = "0.4"
pretty_env_logger = "0.4"
env_logger = "0.7"
[dependencies.jirs-config]
path = "../../shared/jirs-config"
features = ["database"]

View File

@ -88,7 +88,7 @@ impl UpdateIssue {
))
.get_result(conn)
.map_err(|e| {
log::debug!("{:?}", e);
common::log::debug!("{:?}", e);
crate::DatabaseError::GenericFailure(
crate::OperationError::Create,
crate::ResourceKind::Issue,
@ -186,7 +186,7 @@ impl CreateIssue {
.select(sql("COALESCE(max(list_position), 0) + 1"))
.get_result::<i32>(conn)
.map_err(|e| {
log::error!("resolve new issue position failed {}", e);
common::log::error!("resolve new issue position failed {}", e);
crate::DatabaseError::Issue(crate::IssueError::BadListPosition)
})?;
let i_s_id: IssueStatusId = if msg.issue_status_id == 0 {
@ -230,7 +230,7 @@ impl CreateIssue {
}
.execute(conn)?;
issues.find(issue.id).get_result(conn).map_err(|e| {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
crate::DatabaseError::GenericFailure(
crate::OperationError::Create,
crate::ResourceKind::Issue,

View File

@ -75,7 +75,7 @@ impl<'l> Guard<'l> {
use diesel::prelude::*;
let tm = conn.transaction_manager();
tm.begin_transaction(conn).map_err(|e| {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
crate::DatabaseError::DatabaseConnectionLost
})?;
Ok(Self { conn, tm })
@ -91,15 +91,15 @@ impl<'l> Guard<'l> {
match r {
Ok(r) => {
self.tm.commit_transaction(self.conn).map_err(|e| {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
crate::DatabaseError::DatabaseConnectionLost
})?;
Ok(r)
}
Err(e) => {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
self.tm.rollback_transaction(self.conn).map_err(|e| {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
crate::DatabaseError::DatabaseConnectionLost
})?;
Err(e)

View File

@ -2,13 +2,13 @@
macro_rules! db_pool {
($self: expr) => {
&$self.pool.get().map_err(|e| {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
$crate::DatabaseError::DatabaseConnectionLost
})?
};
($self: expr, $pool: expr) => {
&$pool.get().map_err(|e| {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
$crate::DatabaseError::DatabaseConnectionLost
})?
};
@ -18,7 +18,7 @@ macro_rules! db_pool {
macro_rules! q {
($q: expr) => {{
let q = $q;
log::debug!(
common::log::debug!(
"{}",
diesel::debug_query::<diesel::pg::Pg, _>(&q).to_string()
);
@ -40,7 +40,7 @@ macro_rules! db_find {
$crate::q!($q)
.first($conn)
.map_err(|e| {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
$crate::DatabaseError::GenericFailure(
$crate::OperationError::LoadCollection,
$crate::ResourceKind::$resource,
@ -81,7 +81,7 @@ macro_rules! db_load {
$crate::q!($q)
.load(conn)
.map_err(|e| {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
$crate::DatabaseError::GenericFailure(
$crate::OperationError::LoadCollection,
$crate::ResourceKind::$resource,
@ -120,7 +120,7 @@ macro_rules! db_load_field {
$crate::q!($q)
.load(conn)
.map_err(|e| {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
$crate::DatabaseError::GenericFailure(
$crate::OperationError::LoadCollection,
$crate::ResourceKind::$resource,
@ -162,7 +162,7 @@ macro_rules! db_create {
$crate::q!($q)
.get_result::<$resource>($conn)
.map_err(|e| {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
$crate::DatabaseError::GenericFailure(
$crate::OperationError::Create,
$crate::ResourceKind::$resource,
@ -205,7 +205,7 @@ macro_rules! db_update {
$crate::q!($q)
.get_result::<$resource>($conn)
.map_err(|e| {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
$crate::DatabaseError::GenericFailure(
$crate::OperationError::Update,
$crate::ResourceKind::$resource,
@ -247,7 +247,7 @@ macro_rules! db_delete {
$crate::q!($q)
.execute($conn)
.map_err(|e| {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
$crate::DatabaseError::GenericFailure(
$crate::OperationError::Delete,
$crate::ResourceKind::$resource,

View File

@ -18,10 +18,6 @@ actix = { version = "0.10.0" }
futures = { version = "0.3.8" }
log = "0.4"
pretty_env_logger = "0.4"
env_logger = "0.7"
bytes = { version = "0.5.6" }
# Local storage

View File

@ -26,10 +26,6 @@ flate2 = { version = "*" }
syntect = { version = "*" }
lazy_static = { version = "*" }
log = "0.4"
pretty_env_logger = "0.4"
env_logger = "0.7"
[dependencies.jirs-config]
path = "../../shared/jirs-config"
features = ["hi"]

View File

@ -19,10 +19,6 @@ actix = { version = "0.10.0" }
serde = "*"
toml = { version = "*" }
log = "0.4"
pretty_env_logger = "0.4"
env_logger = "0.7"
dotenv = { version = "*" }
uuid = { version = "0.8.1", features = ["serde", "v4", "v5"] }

View File

@ -33,10 +33,6 @@ futures = { version = "0.3.8" }
openssl-sys = { version = "*", features = ["vendored"] }
libc = { version = "0.2.0", default-features = false }
log = "0.4"
pretty_env_logger = "0.4"
env_logger = "0.7"
uuid = { version = "0.8.1", features = ["serde", "v4", "v5"] }
[dependencies.jirs-config]

View File

@ -160,13 +160,13 @@ async fn update_user_avatar(
Ok(Ok(user)) => Ok(user),
Ok(Err(e)) => {
error!("{:?}", e);
common::log::error!("{:?}", e);
Err(actix_web::Error::from(
HttpResponse::Unauthorized().finish(),
))
}
Err(e) => {
error!("{:?}", e);
common::log::error!("{:?}", e);
Err(actix_web::Error::from(
HttpResponse::Unauthorized().finish(),
))
@ -191,11 +191,11 @@ async fn handle_token(
Ok(Ok(user)) => Ok(user.id),
Ok(Err(e)) => {
error!("{:?}", e);
common::log::error!("{:?}", e);
Err(HttpResponse::Unauthorized().finish().into())
}
Err(e) => {
error!("{:?}", e);
common::log::error!("{:?}", e);
Err(HttpResponse::Unauthorized().finish().into())
}
}

View File

@ -1,6 +1,3 @@
#[macro_use]
extern crate log;
use actix::Addr;
use actix_web::web::Data;
use actix_web::{HttpRequest, HttpResponse};

View File

@ -28,10 +28,6 @@ flate2 = { version = "*" }
syntect = { version = "*" }
lazy_static = { version = "*" }
log = { version = "0.4" }
pretty_env_logger = { version = "0.4" }
env_logger = { version = "0.7" }
uuid = { version = "0.8.1", features = ["serde", "v4", "v5"] }
[dependencies.comrak]

View File

@ -1,17 +1,14 @@
#[macro_use]
extern crate log;
use actix::{Actor, ActorContext, Addr, AsyncContext, Handler, Recipient, StreamHandler};
use actix_web::web::{self, Data};
use actix_web::{get, Error, HttpRequest, HttpResponse};
use actix_web_actors::ws;
use common::log::*;
use common::{actix_web, actix_web_actors};
use database_actor::projects::LoadCurrentProject;
use database_actor::user_projects::CurrentUserProject;
use database_actor::DbExecutor;
use futures::executor::block_on;
use jirs_data::{Project, User, UserProject, WsMsg};
use log::*;
use mail_actor::MailExecutor;
use crate::handlers::*;
@ -47,7 +44,7 @@ impl WsMessageSender for ws::WebsocketContext<WebSocketActor> {
fn send_msg(&mut self, msg: &WsMsg) {
match bincode::serialize(msg) {
Err(err) => {
log::error!("{}", err);
common::log::error!("{}", err);
}
Ok(v) => self.binary(v),
}

View File

@ -34,11 +34,11 @@ macro_rules! actor_or_debug_and_return {
match block_on($s.$actor.send($msg)) {
Ok(Ok(r)) => r,
Ok(Err(e)) => {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
return $actor_err;
}
Err(e) => {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
return $mailbox_err;
}
}
@ -56,10 +56,10 @@ macro_rules! actor_or_debug_and_ignore {
$on_success(r);
}
Ok(Err(e)) => {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
}
Err(e) => {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
}
}
};
@ -71,11 +71,11 @@ macro_rules! actor_or_debug_and_fallback {
match block_on($s.$actor.send($msg)) {
Ok(Ok(r)) => r,
Ok(Err(e)) => {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
$actor_err
}
Err(e) => {
log::error!("{:?}", e);
common::log::error!("{:?}", e);
$mailbox_err
}
}

View File

@ -1,6 +1,7 @@
use std::collections::HashMap;
use actix::{Actor, Context, Recipient};
use common::log::*;
use jirs_data::{ProjectId, UserId, WsMsg};
#[derive(actix::Message, Debug)]
@ -110,8 +111,8 @@ impl WsServer {
fn send_to_recipients(&self, recipients: &[Recipient<InnerMsg>], msg: &WsMsg) {
for recipient in recipients.iter() {
match recipient.do_send(InnerMsg::Transfer(msg.clone())) {
Ok(_) => debug!("msg sent"),
Err(e) => error!("{}", e),
Ok(_) => common::log::debug!("msg sent"),
Err(e) => common::log::error!("{}", e),
};
}
}

View File

@ -157,7 +157,7 @@ fn build_create_exec(
use crate::schema::{schema}::dsl::*;
let msg = self;
crate::q!({query}).get_result(conn).map_err(|e| {{
log::error!("{{:?}}", e);
common::log::error!("{{:?}}", e);
crate::DatabaseError::GenericFailure(
crate::OperationError::Create,
crate::ResourceKind::{resource},
@ -192,7 +192,7 @@ fn build_find_exec(
use crate::schema::{schema}::dsl::*;
let msg = self;
crate::q!({query}).first(conn).map_err(|e| {{
log::error!("{{:?}}", e);
common::log::error!("{{:?}}", e);
crate::DatabaseError::GenericFailure(
crate::OperationError::LoadSingle,
crate::ResourceKind::{resource},
@ -226,7 +226,7 @@ fn build_load_exec(
use crate::schema::{schema}::dsl::*;
let msg = self;
crate::q!({query}).load(conn).map_err(|e| {{
log::error!("{{:?}}", e);
common::log::error!("{{:?}}", e);
crate::DatabaseError::GenericFailure(
crate::OperationError::LoadCollection,
crate::ResourceKind::{resource},
@ -260,7 +260,7 @@ fn build_update_exec(
use crate::schema::{schema}::dsl::*;
let msg = self;
crate::q!({query}).get_result(conn).map_err(|e| {{
log::error!("{{:?}}", e);
common::log::error!("{{:?}}", e);
crate::DatabaseError::GenericFailure(
crate::OperationError::Update,
crate::ResourceKind::{resource},
@ -294,7 +294,7 @@ fn build_destroy_exec(
use crate::schema::{schema}::dsl::*;
let msg = self;
crate::q!({query}).execute(conn).map_err(|e| {{
log::error!("{{:?}}", e);
common::log::error!("{{:?}}", e);
crate::DatabaseError::GenericFailure(
crate::OperationError::Delete,
crate::ResourceKind::{resource},

View File

@ -20,4 +20,8 @@ actix_derive = { version = "*" }
serde = { version = "*" }
serde_derive = { version = "*" }
log = "0.4"
pretty_env_logger = "0.4"
env_logger = "0.7"
reexport-proc-macro = { version = "*" }

View File

@ -1,7 +1,10 @@
#[macro_use]
extern crate reexport_proc_macro;
pub use {actix_cors, actix_rt, actix_service, actix_web, actix_web_actors, serde};
pub use {
actix_cors, actix_rt, actix_service, actix_web, actix_web_actors, env_logger, log,
pretty_env_logger, serde,
};
reexport_proc_macro!(actix_derive);
reexport_proc_macro!(serde_derive);