Skip to content

Commit

Permalink
rust: rename start_logging to init_logging
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed May 15, 2024
1 parent ad87956 commit db56ea5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions rust/agama-server/src/agama-dbus-server.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use agama_server::{
l10n::{self, helpers},
logs::start_logging,
logs::init_logging,
questions,
};

Expand All @@ -14,7 +14,7 @@ const SERVICE_NAME: &str = "org.opensuse.Agama1";
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let locale = helpers::init_locale()?;
start_logging().context("Could not initialize the logger")?;
init_logging().context("Could not initialize the logger")?;

let connection = connection_to(ADDRESS)
.await
Expand Down
4 changes: 2 additions & 2 deletions rust/agama-server/src/agama-web-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::{
use agama_lib::connection_to;
use agama_server::{
l10n::helpers,
logs::start_logging,
logs::init_logging,
web::{self, generate_token, run_monitor},
};
use anyhow::Context;
Expand Down Expand Up @@ -292,7 +292,7 @@ async fn start_server(address: String, service: Router, ssl_acceptor: SslAccepto
/// Start serving the API.
/// `options`: command-line arguments.
async fn serve_command(args: ServeArgs) -> anyhow::Result<()> {
start_logging().context("Could not initialize the logger")?;
init_logging().context("Could not initialize the logger")?;

let (tx, _) = channel(16);
run_monitor(tx.clone()).await?;
Expand Down
2 changes: 1 addition & 1 deletion rust/agama-server/src/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use tracing_subscriber::prelude::*;
/// Initializes the logging mechanism.
///
/// It is based on [Tracing](https://github.com/tokio-rs/tracing), part of the Tokio ecosystem.
pub fn start_logging() -> anyhow::Result<()> {
pub fn init_logging() -> anyhow::Result<()> {
if logging::connected_to_journal() {
let journald = tracing_journald::layer().context("could not connect to journald")?;
tracing_subscriber::registry().with(journald).init();
Expand Down

0 comments on commit db56ea5

Please sign in to comment.