Commit Graph

7 Commits

Author SHA1 Message Date
David Sterba 8025583af3 btrfs-progs: use common define error and warning message prefixes
Define the message prefix in one place.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-10-11 09:08:10 +02:00
David Sterba a827bb2db8 btrfs-progs: use template for transaction commit error messages
Signed-off-by: David Sterba <dsterba@suse.com>
2022-10-11 09:08:10 +02:00
David Sterba 8fcafae04a btrfs-progs: use template for transaction start error messages
Signed-off-by: David Sterba <dsterba@suse.com>
2022-10-11 09:08:10 +02:00
David Sterba 74eb8c68cf btrfs-progs: add template for common error messages
There are several generic errors that repeat the same message. Define a
template for such messages, with optional text.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-10-11 09:08:09 +02:00
David Sterba d35b7f87c4 btrfs-progs: factor out common message helper for internal errors
In a few occasions there's an internal report, make a common helper so
the prefix message is not necessary and the stack trace can be printed
if enabled.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-10-11 09:08:09 +02:00
Anand Jain 018448ed62 btrfs-progs: add global verbose and quiet options and helper functions
Add --verbose and --quiet command options to show verbose or no output
from the subcommands.  By introducing global a bconf::verbose memeber to
propagate the same down to the subcommand.

Further the added helper function pr_verbose() helps to logs the verbose
messages, based on the state of the %bconf::verbose. And further HELPINFO_
defines are provided for the usage.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-06-12 19:30:43 +02:00
David Sterba d1efe50d0a btrfs-progs: move messages.[ch] to common/
Signed-off-by: David Sterba <dsterba@suse.com>
2019-07-03 20:49:03 +02:00