|
22 | 22 | #include <string> |
23 | 23 | #include <vector> |
24 | 24 |
|
| 25 | +#include "logging.hxx" |
25 | 26 | #include "optparse.hxx" |
26 | 27 | #include "wildcards.hpp" |
27 | 28 |
|
@@ -107,12 +108,6 @@ positional arguments: |
107 | 108 | Display contents of the ROOT file 'example.root', traversing recursively any TDirectory. |
108 | 109 | )"; |
109 | 110 |
|
110 | | -static ROOT::RLogChannel &RootLsChannel() |
111 | | -{ |
112 | | - static ROOT::RLogChannel sLog("ROOTLS"); |
113 | | - return sLog; |
114 | | -} |
115 | | - |
116 | 111 | static bool ClassInheritsFrom(const char *class_, const char *baseClass) |
117 | 112 | { |
118 | 113 | const auto *cl = TClass::GetClass(class_); |
@@ -385,7 +380,7 @@ static void PrintNodesDetailed(std::ostream &stream, const RootLsTree &tree, |
385 | 380 | const auto &desc = reader->GetDescriptor(); |
386 | 381 | PrintRNTuple(stream, desc, indent + 2, desc.GetFieldZero()); |
387 | 382 | } else { |
388 | | - R__LOG_ERROR(RootLsChannel()) << "failed to read RNTuple object: " << child.fName; |
| 383 | + Err() << "failed to read RNTuple object: " << child.fName; |
389 | 384 | } |
390 | 385 | } |
391 | 386 | } |
@@ -691,7 +686,7 @@ static RootLsArgs ParseArgs(const char **args, int nArgs) |
691 | 686 |
|
692 | 687 | opts.Parse(args, nArgs); |
693 | 688 | for (const auto &err : opts.GetErrors()) |
694 | | - R__LOG_ERROR(RootLsChannel()) << err; |
| 689 | + Err() << err; |
695 | 690 |
|
696 | 691 | if (opts.GetSwitch("help")) { |
697 | 692 | outArgs.fPrintUsageAndExit = RootLsArgs::EPrintUsage::kLong; |
@@ -745,6 +740,8 @@ int main(int argc, char **argv) |
745 | 740 | // Ignore diagnostics up to (but excluding) kError to avoid spamming users with TClass::Init warnings. |
746 | 741 | gErrorIgnoreLevel = kError; |
747 | 742 |
|
| 743 | + InitLog("rootls"); |
| 744 | + |
748 | 745 | auto args = ParseArgs(const_cast<const char **>(argv) + 1, argc - 1); |
749 | 746 | if (args.fPrintUsageAndExit != RootLsArgs::EPrintUsage::kNo) { |
750 | 747 | std::cerr << "usage: rootls [-1hltr] FILE [FILE ...]\n"; |
|
0 commit comments