Skip to content

Commit e5a3fa2

Browse files
committed
[main] use logging.hxx in rootbrowse
1 parent d5a2215 commit e5a3fa2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

main/src/rootbrowse.cxx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/// \date 2025-08-21
77
#include <ROOT/RLogger.hxx>
88

9+
#include "logging.hxx"
910
#include "optparse.hxx"
1011

1112
#include <TApplication.h>
@@ -44,12 +45,6 @@ positional arguments:
4445
Open the ROOT file 'file.root' in a TBrowser
4546
)";
4647

47-
static ROOT::RLogChannel &RootBrowseLog()
48-
{
49-
static ROOT::RLogChannel channel("RootBrowse");
50-
return channel;
51-
}
52-
5348
struct RootBrowseArgs {
5449
enum class EPrintUsage {
5550
kNo,
@@ -97,6 +92,8 @@ static RootBrowseArgs ParseArgs(const char **args, int nArgs)
9792

9893
int main(int argc, char **argv)
9994
{
95+
InitLog("rootbrowse");
96+
10097
auto args = ParseArgs(const_cast<const char **>(argv) + 1, argc - 1);
10198
if (args.fPrintHelp != RootBrowseArgs::EPrintUsage::kNo) {
10299
std::cerr << kShortHelp;
@@ -119,7 +116,8 @@ int main(int argc, char **argv)
119116
gErrorIgnoreLevel = kError;
120117
file = std::unique_ptr<TFile>(TFile::Open(std::string(args.fFileName).c_str(), "READ"));
121118
if (!file || file->IsZombie()) {
122-
R__LOG_WARNING(RootBrowseLog()) << "File " << args.fFileName << " does not exist or is unreadable.";
119+
Err() << "File " << args.fFileName << " does not exist or is unreadable.";
120+
return 1;
123121
}
124122
gErrorIgnoreLevel = kUnset;
125123
}

0 commit comments

Comments
 (0)