Skip to content

Commit

Permalink
Print successful mount for both foreground and background modes.
Browse files Browse the repository at this point in the history
Also, update documentation for the `--no-log` argument.

Signed-off-by: Andres Santana <[email protected]>
  • Loading branch information
arsh committed Dec 7, 2023
1 parent e9d7043 commit c233d38
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion doc/LOGGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ Log files are not automatically rotated or cleaned up.

## Disabling logging

If you do not want to record any logs, use the `--no-log` command-line argument. This argument cannot be combined with other logging-related command-line arguments.
If you do not want to record any logs, use the `--no-log` command-line argument. This argument cannot be combined with other logging-related command-line arguments. The `--no-log` argument has
no effect on messages sent to the standard output. If no output is desired, consider redirecting it.

## Verbose logging

Expand Down
11 changes: 5 additions & 6 deletions mountpoint-s3/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ struct CliArgs {

#[clap(
long,
help = "Disable all logging",
help = "Disable all logging. You will still see stdout messages.",
help_heading = LOGGING_OPTIONS_HEADER,
conflicts_with_all(["log_directory", "debug", "debug_crt", "log_metrics"])
)]
Expand Down Expand Up @@ -351,6 +351,7 @@ impl CliArgs {

fn main() -> anyhow::Result<()> {
let args = CliArgs::parse();
let successful_mount_msg = format!("{} is mounted at {}", args.bucket_description(), args.mount_point.display());

if args.foreground {
init_logging(args.logging_config()).context("failed to initialize logging")?;
Expand All @@ -360,6 +361,8 @@ fn main() -> anyhow::Result<()> {
// mount file system as a foreground process
let session = mount(args)?;

println!("{successful_mount_msg}");

session.join().context("failed to join session")?;
} else {
// mount file system as a background process
Expand Down Expand Up @@ -447,11 +450,7 @@ fn main() -> anyhow::Result<()> {
let status = receiver.recv_timeout(timeout);
match status {
Ok('0') => {
println!(
"{} is mounted at {}",
args.bucket_description(),
args.mount_point.display()
);
println!("{successful_mount_msg}");
tracing::debug!("success status flag received from child process")
}
Ok(_) => {
Expand Down

0 comments on commit c233d38

Please sign in to comment.