From 203ca9d617095c5bd375a015140766f4182343b4 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 5 Dec 2023 17:35:59 +0100 Subject: [PATCH] Print version to log (#4226) * Print version to log * Keep cargofmt happy * Keep cargo_fmt happy * Keep Clippy happy --- src/lib.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 6edcf1b37..ede4bb8f0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -49,6 +49,7 @@ use lemmy_utils::{ rate_limit::RateLimitCell, response::jsonify_plain_text_errors, settings::{structs::Settings, SETTINGS}, + version, }; use prometheus::default_registry; use prometheus_metrics::serve_prometheus; @@ -108,6 +109,9 @@ pub struct CmdArgs { /// Placing the main function in lib.rs allows other crates to import it and embed Lemmy pub async fn start_lemmy_server(args: CmdArgs) -> Result<(), LemmyError> { + // Print version number to log + println!("Lemmy v{}", version::VERSION); + // return error 503 while running db migrations and startup tasks let mut startup_server_handle = None; if args.http_server { @@ -133,7 +137,7 @@ pub async fn start_lemmy_server(args: CmdArgs) -> Result<(), LemmyError> { let federation_enabled = local_site.federation_enabled; if federation_enabled { - println!("federation enabled, host is {}", &SETTINGS.hostname); + println!("Federation enabled, host is {}", &SETTINGS.hostname); } check_private_instance_and_federation_enabled(&local_site)?; @@ -144,7 +148,7 @@ pub async fn start_lemmy_server(args: CmdArgs) -> Result<(), LemmyError> { let rate_limit_cell = RateLimitCell::new(rate_limit_config); println!( - "Starting http server at {}:{}", + "Starting HTTP server at {}:{}", SETTINGS.bind, SETTINGS.port );