Skip to content

Commit 4191eee

Browse files
Merge pull request #11 from theseus-rs/update-tracing-levels
chore: change tracing levels from info to debug
2 parents 66a1e31 + a48361a commit 4191eee

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
CARGO_TERM_COLOR: always
5656
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
5757
LLVM_PROFILE_FILE: postgresql-%p-%m.profraw
58-
RUST_LOG: "info"
58+
RUST_LOG: "info,postgresql_archive=debug,postgresql_embedded=debug"
5959
RUST_LOG_SPAN_EVENTS: full
6060
RUSTFLAGS: -Cinstrument-coverage
6161
RUSTDOCFLAGS: -Cinstrument-coverage

postgresql_archive/src/archive.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ use std::io::{copy, BufReader, Cursor};
1616
use std::path::Path;
1717
use std::str::FromStr;
1818
use tar::Archive;
19-
use tracing::{debug, info, warn};
19+
use tracing::{debug, warn};
2020

2121
const GITHUB_API_VERSION_HEADER: &str = "X-GitHub-Api-Version";
2222
const GITHUB_API_VERSION: &str = "2022-11-28";
2323

2424
lazy_static! {
2525
static ref GITHUB_TOKEN: Option<String> = match std::env::var("GITHUB_TOKEN") {
2626
Ok(token) => {
27-
info!("GITHUB_TOKEN environment variable found");
27+
debug!("GITHUB_TOKEN environment variable found");
2828
Some(token)
2929
}
3030
Err(_) => None,
@@ -79,7 +79,7 @@ async fn get_release(version: &Version) -> Result<Release> {
7979
let response = request.send().await?.error_for_status()?;
8080
let release = response.json::<Release>().await?;
8181

82-
info!("Release found for version {version}");
82+
debug!("Release found for version {version}");
8383
return Ok(release);
8484
}
8585

@@ -127,7 +127,7 @@ async fn get_release(version: &Version) -> Result<Release> {
127127
match result {
128128
Some(release) => {
129129
let release_version = Version::from_str(&release.tag_name)?;
130-
info!("Release {release_version} found for version {version}");
130+
debug!("Release {release_version} found for version {version}");
131131
Ok(release)
132132
}
133133
None => Err(ReleaseNotFound(version.to_string())),
@@ -211,7 +211,7 @@ pub async fn get_archive_for_target<S: AsRef<str>>(
211211
Some(hash) => hash.as_str().to_string(),
212212
None => return Err(AssetHashNotFound(asset.name)),
213213
};
214-
info!(
214+
debug!(
215215
"Archive hash {} downloaded: {}",
216216
asset_hash.browser_download_url,
217217
human_bytes(text.len() as f64)
@@ -223,7 +223,7 @@ pub async fn get_archive_for_target<S: AsRef<str>>(
223223
.add_github_headers()?;
224224
let response = request.send().await?.error_for_status()?;
225225
let archive: Bytes = response.bytes().await?;
226-
info!(
226+
debug!(
227227
"Archive {} downloaded: {}",
228228
asset.browser_download_url,
229229
human_bytes(archive.len() as f64)
@@ -286,7 +286,7 @@ pub async fn extract(bytes: &Bytes, out_dir: &Path) -> Result<()> {
286286
}
287287
}
288288

289-
info!(
289+
debug!(
290290
"Extracting {} files totalling {}",
291291
files.to_formatted_string(&Locale::en),
292292
human_bytes(extracted_bytes as f64)

postgresql_embedded/src/postgresql.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::net::TcpListener;
2020
use std::ops::Deref;
2121
#[cfg(feature = "bundled")]
2222
use std::str::FromStr;
23-
use tracing::{debug, info};
23+
use tracing::debug;
2424

2525
use crate::command::psql::PsqlBuilder;
2626
use crate::Error::{CreateDatabaseError, DatabaseExistsError, DropDatabaseError};
@@ -30,7 +30,7 @@ lazy_static::lazy_static! {
3030
pub(crate) static ref ARCHIVE_VERSION: Version = {
3131
let version_string = include_str!(concat!(std::env!("OUT_DIR"), "/postgresql.version"));
3232
let version = Version::from_str(version_string).unwrap();
33-
info!("Bundled installation archive version {version}");
33+
debug!("Bundled installation archive version {version}");
3434
version
3535
};
3636
}
@@ -231,7 +231,7 @@ impl PostgreSQL {
231231
}
232232
}
233233

234-
info!(
234+
debug!(
235235
"Installed PostgreSQL version {} to {}",
236236
self.version,
237237
self.settings.installation_dir.to_string_lossy()
@@ -271,7 +271,7 @@ impl PostgreSQL {
271271
match self.execute_command(initdb).await {
272272
Ok((_stdout, _stderr)) => {
273273
self.status = Status::Stopped;
274-
info!(
274+
debug!(
275275
"Initialized database {}",
276276
self.settings.data_dir.to_string_lossy()
277277
);
@@ -311,7 +311,7 @@ impl PostgreSQL {
311311
match self.execute_command(pg_ctl).await {
312312
Ok((_stdout, _stderr)) => {
313313
self.status = Status::Started;
314-
info!(
314+
debug!(
315315
"Started database {} on port {}",
316316
self.settings.data_dir.to_string_lossy(),
317317
self.settings.port
@@ -342,7 +342,7 @@ impl PostgreSQL {
342342
match self.execute_command(pg_ctl).await {
343343
Ok((_stdout, _stderr)) => {
344344
self.status = Status::Stopped;
345-
info!(
345+
debug!(
346346
"Stopped database {}",
347347
self.settings.data_dir.to_string_lossy()
348348
);
@@ -375,7 +375,7 @@ impl PostgreSQL {
375375

376376
match self.execute_command(psql).await {
377377
Ok((_stdout, _stderr)) => {
378-
info!(
378+
debug!(
379379
"Created database {} for {}:{}",
380380
database_name.as_ref(),
381381
self.settings.host,
@@ -440,7 +440,7 @@ impl PostgreSQL {
440440

441441
match self.execute_command(psql).await {
442442
Ok((_stdout, _stderr)) => {
443-
info!(
443+
debug!(
444444
"Dropped database {} for {}:{}",
445445
database_name.as_ref(),
446446
self.settings.host,

0 commit comments

Comments
 (0)