Skip to content

Commit 42bf7eb

Browse files
committed
for rocket master branch (0.6 dev)
1 parent 8dec59a commit 42bf7eb

File tree

31 files changed

+105
-41
lines changed

31 files changed

+105
-41
lines changed

Cargo.toml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,25 @@ resolver = "2"
1919

2020
[workspace.dependencies]
2121
log = "0.4"
22-
rocket = { version = "=0.5.1", default-features = false, features = ["json"] }
23-
rocket_ws = "0.1.1"
24-
rocket_http = "=0.5.1"
25-
rocket_dyn_templates = "=0.2.0"
26-
rocket_db_pools = "=0.2.0"
27-
rocket_sync_db_pools = "=0.1.0"
22+
# Use the development Rocket from the rwf2 fork branch `master` for the workspace
23+
rocket = { git = "https://github.com/rwf2/Rocket.git", branch = "master", default-features = false, features = [
24+
"json",
25+
"http2",
26+
"http3-preview",
27+
] }
28+
rocket_ws = { git = "https://github.com/rwf2/Rocket.git", branch = "master" }
29+
rocket_http = { git = "https://github.com/rwf2/Rocket.git", branch = "master" }
30+
rocket_dyn_templates = { git = "https://github.com/rwf2/Rocket.git", branch = "master" }
31+
rocket_db_pools = { git = "https://github.com/rwf2/Rocket.git", branch = "master" }
32+
rocket_sync_db_pools = { git = "https://github.com/rwf2/Rocket.git", branch = "master" }
2833
schemars = "1.1.0"
2934
serde = "1.0"
3035
serde_json = "1.0"
36+
37+
[patch.crates-io]
38+
rocket = { git = "https://github.com/rwf2/Rocket.git", branch = "master" }
39+
rocket_http = { git = "https://github.com/rwf2/Rocket.git", branch = "master" }
40+
rocket_ws = { git = "https://github.com/rwf2/Rocket.git", branch = "master" }
41+
rocket_dyn_templates = { git = "https://github.com/rwf2/Rocket.git", branch = "master" }
42+
rocket_db_pools = { git = "https://github.com/rwf2/Rocket.git", branch = "master" }
43+
rocket_sync_db_pools = { git = "https://github.com/rwf2/Rocket.git", branch = "master" }

examples/custom_schema/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ serde = { workspace = true, features = ["derive"] }
1414
schemars = "1.1.0"
1515

1616
serde_json = "1.0"
17+
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }

examples/custom_schema/src/main.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use rocket::{Build, Rocket};
2+
use tracing_subscriber::EnvFilter;
23
use rocket_okapi::okapi::openapi3::OpenApi;
34
use rocket_okapi::settings::UrlObject;
45
use rocket_okapi::{mount_endpoints_and_merged_docs, rapidoc::*, swagger_ui::*};
@@ -13,6 +14,10 @@ pub type DataResult<'a, T> =
1314

1415
#[rocket::main]
1516
async fn main() {
17+
// Initialize tracing subscriber so `RUST_LOG` controls the logging output.
18+
// Default to `info` if `RUST_LOG` is not set.
19+
let env_filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"));
20+
tracing_subscriber::fmt().with_env_filter(env_filter).init();
1621
let launch_result = create_server().launch().await;
1722
match launch_result {
1823
Ok(_) => println!("Rocket shut down gracefully."),

examples/dyn_templates/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ edition = "2021"
66

77
[dependencies]
88
rocket = { workspace = true }
9-
schemars = { workspace = true }
109
rocket_okapi = { path = "../../rocket-okapi", features = [
1110
"swagger",
1211
"rapidoc",
@@ -15,6 +14,7 @@ rocket_okapi = { path = "../../rocket-okapi", features = [
1514
serde = { workspace = true, features = ["derive"] }
1615
rocket_dyn_templates = { workspace = true, features = ["handlebars"] }
1716
handlebars = "5.0.0"
17+
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
1818

1919
[dev-dependencies]
2020
serde_json = "1.0"

examples/dyn_templates/src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use rocket::get;
22
use rocket_dyn_templates::{context, Template};
33
use rocket_okapi::settings::UrlObject;
44
use rocket_okapi::{openapi, openapi_get_routes, rapidoc::*, swagger_ui::*};
5+
use tracing_subscriber::EnvFilter;
56

67
/// # Get Page
78
///
@@ -14,6 +15,9 @@ fn get_page(name: String) -> Template {
1415

1516
#[rocket::main]
1617
async fn main() {
18+
// Initialize tracing subscriber so RUST_LOG controls logging
19+
let env_filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"));
20+
tracing_subscriber::fmt().with_env_filter(env_filter).init();
1721
let launch_result = rocket::build()
1822
.mount("/", openapi_get_routes![get_page])
1923
.mount(

examples/json-web-api/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ rocket_okapi = { path = "../../rocket-okapi", features = [
1212
] }
1313
serde = { workspace = true, features = ["derive"] }
1414
schemars = "1.1.0"
15+
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
1516

1617
[dev-dependencies]
1718
serde_json = "1.0"

examples/json-web-api/src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use rocket_okapi::okapi::schemars::JsonSchema;
55
use rocket_okapi::settings::UrlObject;
66
use rocket_okapi::{openapi, openapi_get_routes, rapidoc::*, swagger_ui::*};
77
use serde::{Deserialize, Serialize};
8+
use tracing_subscriber::EnvFilter;
89

910
#[derive(Serialize, Deserialize, JsonSchema)]
1011
#[serde(rename_all = "camelCase")]
@@ -94,6 +95,9 @@ fn create_post_by_query(post: Post) -> Option<Json<Post>> {
9495

9596
#[rocket::main]
9697
async fn main() {
98+
// Initialize tracing subscriber so RUST_LOG controls logging
99+
let env_filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"));
100+
tracing_subscriber::fmt().with_env_filter(env_filter).init();
97101
let launch_result = rocket::build()
98102
.mount(
99103
"/",

examples/nested/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ rocket = { workspace = true }
1212
rocket_okapi = { path = "../../rocket-okapi", features = ["rapidoc"] }
1313
serde = { workspace = true, features = ["derive"] }
1414
serde_json = "1.0"
15+
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
1516
schemars = "1.1.0"
1617

1718
[dev-dependencies]

examples/nested/src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use rocket::{Build, Rocket};
2+
use tracing_subscriber::EnvFilter;
23
use rocket_okapi::okapi::openapi3::OpenApi;
34
use rocket_okapi::settings::UrlObject;
45
use rocket_okapi::{mount_endpoints_and_merged_docs, rapidoc::*};
@@ -12,6 +13,9 @@ pub type DataResult<'a, T> =
1213

1314
#[rocket::main]
1415
async fn main() {
16+
// Initialize tracing subscriber so RUST_LOG controls logging
17+
let env_filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"));
18+
tracing_subscriber::fmt().with_env_filter(env_filter).init();
1519
let launch_result = create_server().launch().await;
1620
match launch_result {
1721
Ok(_) => println!("Rocket shut down gracefully."),

examples/openapi_attributes/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ rocket_okapi = { path = "../../rocket-okapi", features = [
1212
] }
1313
serde = { workspace = true }
1414
schemars = "1.1.0"
15+
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
1516

1617
[dev-dependencies]
1718
serde_json = "1.0"

0 commit comments

Comments
 (0)