Skip to content

Commit 438ffbe

Browse files
author
pingoo
committed
config: improve config logging
1 parent 8b6e8b0 commit 438ffbe

6 files changed

Lines changed: 12 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions:
1616

1717
env:
1818
DOCKER_IMAGE_GITHUB: ghcr.io/pingooio/pingoo
19-
DOCKER_IMAGE: pingooio/pingoo
19+
DOCKER_IMAGE: docker.io/pingooio/pingoo
2020

2121
jobs:
2222
docker_build:

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pingoo"
3-
version = "0.14.4"
3+
version = "0.14.5"
44
edition = "2024"
55

66
[[bin]]

pingoo/config/config.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use http::StatusCode;
1010
use indexmap::IndexMap;
1111
use serde::{Deserialize, Serialize};
1212
use tokio::fs;
13-
use tracing::{debug, info, warn};
13+
use tracing::{debug, warn};
1414

1515
use crate::{
1616
Error,
@@ -200,8 +200,6 @@ pub async fn load_and_validate() -> Result<Config, Error> {
200200
.await
201201
.map_err(|err| Error::Config(format!("error reading config file ({DEFAULT_CONFIG_FILE}): {err}")))?;
202202

203-
info!("configuration successfully loaded from {DEFAULT_CONFIG_FILE}");
204-
205203
let mut config_file: ConfigFile = serde_yaml::from_slice(&raw_config)
206204
.map_err(|err| Error::Config(format!("error parsing config file ({DEFAULT_CONFIG_FILE}): {err}")))?;
207205

pingoo/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ mod tls;
2222
pub use error::Error;
2323

2424
use crate::{listeners::GRACEFUL_SHUTDOWN_TIMEOUT, server::Server};
25+
use config::DEFAULT_CONFIG_FILE;
2526

2627
// We don't use mimalloc in debug builds to speedup compilation
2728
// #[cfg(not(debug_assertions))]
@@ -47,6 +48,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
4748
.map_err(|err| Error::Config(format!("error setting up rustls crypto provider: {err:?}")))?;
4849

4950
let config = config::load_and_validate().await?;
51+
info!(
52+
services = config.services.len(),
53+
listeners = config.listeners.len(),
54+
"configuration successfully loaded from {DEFAULT_CONFIG_FILE}"
55+
);
5056

5157
let (shutdown_tx, shutdown_rx) = watch::channel(());
5258
tokio::spawn(shutdown_signal(shutdown_tx));

pingoo/services/http_static_site_service.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,12 @@ async fn try_metadata(path: &PathBuf) -> Result<Metadata, Response<BoxBody<Bytes
262262
Ok(metadata) if metadata.is_dir() => {
263263
debug!("error getting {path:?}: is a directory");
264264
Err(new_not_found_error())
265-
},
265+
}
266266
Ok(metadata) => Ok(metadata),
267267
Err(error) if error.kind() == std::io::ErrorKind::NotFound => {
268268
debug!("error getting {path:?}: not found");
269269
Err(new_not_found_error())
270-
},
270+
}
271271
Err(err) => {
272272
error!("error getting metadata for static file: {path:?}: {err}");
273273
Err(new_internal_error_response_500())

0 commit comments

Comments
 (0)