From: Hannes Laimer <h.laimer@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup v3 01/10] bins: init cli logger
Date: Wed, 15 Jun 2022 08:19:48 +0000 [thread overview]
Message-ID: <20220615081957.33511-3-h.laimer@proxmox.com> (raw)
In-Reply-To: <20220615081957.33511-1-h.laimer@proxmox.com>
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
pbs-tape/src/bin/pmt.rs | 2 ++
pbs-tape/src/bin/pmtx.rs | 2 ++
proxmox-backup-client/src/main.rs | 1 +
proxmox-file-restore/src/main.rs | 6 ++++--
pxar-bin/src/main.rs | 2 ++
src/bin/proxmox-backup-debug.rs | 4 +++-
src/bin/proxmox-backup-manager.rs | 2 ++
src/bin/proxmox-tape.rs | 2 ++
src/bin/sg-tape-cmd.rs | 2 ++
9 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/pbs-tape/src/bin/pmt.rs b/pbs-tape/src/bin/pmt.rs
index 5f4f6074..75e8e93a 100644
--- a/pbs-tape/src/bin/pmt.rs
+++ b/pbs-tape/src/bin/pmt.rs
@@ -801,6 +801,8 @@ fn options(
}
fn main() -> Result<(), Error> {
+ init_cli_logger("PBS_LOG", "info");
+
let uid = nix::unistd::Uid::current();
let username = match nix::unistd::User::from_uid(uid)? {
diff --git a/pbs-tape/src/bin/pmtx.rs b/pbs-tape/src/bin/pmtx.rs
index cea62c74..1d58d737 100644
--- a/pbs-tape/src/bin/pmtx.rs
+++ b/pbs-tape/src/bin/pmtx.rs
@@ -387,6 +387,8 @@ fn scan(param: Value) -> Result<(), Error> {
}
fn main() -> Result<(), Error> {
+ init_cli_logger("PBS_LOG", "info");
+
let uid = nix::unistd::Uid::current();
let username = match nix::unistd::User::from_uid(uid)? {
diff --git a/proxmox-backup-client/src/main.rs b/proxmox-backup-client/src/main.rs
index 6d0e533a..0d6558e7 100644
--- a/proxmox-backup-client/src/main.rs
+++ b/proxmox-backup-client/src/main.rs
@@ -1616,6 +1616,7 @@ impl ReadAt for BufferedDynamicReadAt {
fn main() {
pbs_tools::setup_libc_malloc_opts();
+ init_cli_logger("PBS_LOG", "info");
let backup_cmd_def = CliCommand::new(&API_METHOD_CREATE_BACKUP)
.arg_param(&["backupspec"])
diff --git a/proxmox-file-restore/src/main.rs b/proxmox-file-restore/src/main.rs
index 3420ea8e..5795b994 100644
--- a/proxmox-file-restore/src/main.rs
+++ b/proxmox-file-restore/src/main.rs
@@ -8,8 +8,8 @@ use serde_json::{json, Value};
use proxmox_router::cli::{
complete_file_name, default_table_format_options, format_and_print_result_full,
- get_output_format, run_cli_command, CliCommand, CliCommandMap, CliEnvironment, ColumnConfig,
- OUTPUT_FORMAT,
+ get_output_format, init_cli_logger, run_cli_command, CliCommand, CliCommandMap, CliEnvironment,
+ ColumnConfig, OUTPUT_FORMAT,
};
use proxmox_router::{http_err, HttpError};
use proxmox_schema::api;
@@ -530,6 +530,8 @@ where
}
fn main() {
+ init_cli_logger("PBS_LOG", "info");
+
let list_cmd_def = CliCommand::new(&API_METHOD_LIST)
.arg_param(&["snapshot", "path"])
.completion_cb("repository", complete_repository)
diff --git a/pxar-bin/src/main.rs b/pxar-bin/src/main.rs
index 78ec31c8..e3eba213 100644
--- a/pxar-bin/src/main.rs
+++ b/pxar-bin/src/main.rs
@@ -442,6 +442,8 @@ fn dump_archive(archive: String, verbose: bool) -> Result<(), Error> {
}
fn main() {
+ init_cli_logger("PXAR_LOG", "info");
+
let cmd_def = CliCommandMap::new()
.insert(
"create",
diff --git a/src/bin/proxmox-backup-debug.rs b/src/bin/proxmox-backup-debug.rs
index e467c956..c8ea0539 100644
--- a/src/bin/proxmox-backup-debug.rs
+++ b/src/bin/proxmox-backup-debug.rs
@@ -1,5 +1,5 @@
use proxmox_router::{
- cli::{run_cli_command, CliCommandMap, CliEnvironment},
+ cli::{init_cli_logger, run_cli_command, CliCommandMap, CliEnvironment},
RpcEnvironment,
};
@@ -7,6 +7,8 @@ mod proxmox_backup_debug;
use proxmox_backup_debug::*;
fn main() {
+ init_cli_logger("PBS_LOG", "info");
+
let cmd_def = CliCommandMap::new()
.insert("inspect", inspect::inspect_commands())
.insert("recover", recover::recover_commands())
diff --git a/src/bin/proxmox-backup-manager.rs b/src/bin/proxmox-backup-manager.rs
index 89598c90..0ca3e990 100644
--- a/src/bin/proxmox-backup-manager.rs
+++ b/src/bin/proxmox-backup-manager.rs
@@ -413,6 +413,8 @@ async fn get_versions(verbose: bool, param: Value) -> Result<Value, Error> {
}
async fn run() -> Result<(), Error> {
+ init_cli_logger("PBS_LOG", "info");
+
let cmd_def = CliCommandMap::new()
.insert("acl", acl_commands())
.insert("datastore", datastore_commands())
diff --git a/src/bin/proxmox-tape.rs b/src/bin/proxmox-tape.rs
index 94114a6e..9cb3978f 100644
--- a/src/bin/proxmox-tape.rs
+++ b/src/bin/proxmox-tape.rs
@@ -989,6 +989,8 @@ async fn catalog_media(mut param: Value) -> Result<(), Error> {
}
fn main() {
+ init_cli_logger("PBS_LOG", "info");
+
let cmd_def = CliCommandMap::new()
.insert(
"backup",
diff --git a/src/bin/sg-tape-cmd.rs b/src/bin/sg-tape-cmd.rs
index fe301ba2..402fe9cb 100644
--- a/src/bin/sg-tape-cmd.rs
+++ b/src/bin/sg-tape-cmd.rs
@@ -123,6 +123,8 @@ fn set_encryption(
}
fn main() -> Result<(), Error> {
+ init_cli_logger("PBS_LOG", "info");
+
// check if we are user root or backup
let backup_uid = pbs_config::backup_user()?.uid;
let backup_gid = pbs_config::backup_group()?.gid;
--
2.30.2
next prev parent reply other threads:[~2022-06-15 8:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-15 8:19 [pbs-devel] [PATCH-SERIES proxmox-backup/proxmox v3 00/10] replace print by log macro in libraries Hannes Laimer
2022-06-15 8:19 ` [pbs-devel] [PATCH proxmox v3 1/1] router: add init_cli_logger helper function Hannes Laimer
2022-06-21 8:40 ` [pbs-devel] applied: " Wolfgang Bumiller
2022-06-15 8:19 ` Hannes Laimer [this message]
2022-06-15 8:19 ` [pbs-devel] [PATCH proxmox-backup v3 02/10] pbs-client: replace print with log macro Hannes Laimer
2022-06-15 8:19 ` [pbs-devel] [PATCH proxmox-backup v3 03/10] pbs-datastore: " Hannes Laimer
2022-06-15 8:19 ` [pbs-devel] [PATCH proxmox-backup v3 04/10] pbs-fuse+pbs-tape: " Hannes Laimer
2022-06-15 8:19 ` [pbs-devel] [PATCH proxmox-backup v3 05/10] proxmox-backup-client: " Hannes Laimer
2022-06-15 8:19 ` [pbs-devel] [PATCH proxmox-backup v3 06/10] proxmox-file-restore: " Hannes Laimer
2022-06-15 8:19 ` [pbs-devel] [PATCH proxmox-backup v3 07/10] proxmox-rest-server: " Hannes Laimer
2022-06-15 8:19 ` [pbs-devel] [PATCH proxmox-backup v3 08/10] " Hannes Laimer
2022-06-15 8:19 ` [pbs-devel] [PATCH proxmox-backup v3 09/10] docs: add note for setting verbosity level Hannes Laimer
2022-06-15 8:19 ` [pbs-devel] [PATCH proxmox-backup v3 10/10] fixed_index: remove unused 'print_info' function Hannes Laimer
2022-06-21 8:46 ` [pbs-devel] applied-series: [PATCH-SERIES proxmox-backup/proxmox v3 00/10] replace print by log macro in libraries Wolfgang Bumiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220615081957.33511-3-h.laimer@proxmox.com \
--to=h.laimer@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.