diff options
| author | Stefan Boberg <[email protected]> | 2021-09-16 21:05:22 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-16 21:05:22 +0200 |
| commit | f26790ef625625eb9b62799e646e772ae0291ca7 (patch) | |
| tree | 4116259a2529d81b3804a5b3717a7f689e2d5673 | |
| parent | Added ZEN_CONSOLE macro, which logs the output directly to console (diff) | |
| download | zen-f26790ef625625eb9b62799e646e772ae0291ca7.tar.xz zen-f26790ef625625eb9b62799e646e772ae0291ca7.zip | |
Improved top/ps behaviour
| -rw-r--r-- | zen/cmds/top.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/zen/cmds/top.cpp b/zen/cmds/top.cpp index 5bb11d0a0..b0d684705 100644 --- a/zen/cmds/top.cpp +++ b/zen/cmds/top.cpp @@ -23,7 +23,9 @@ TopCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) ZenServerState State; if (!State.InitializeReadOnly()) { - ZEN_INFO("no Zen state found"); + ZEN_CONSOLE("no Zen state found"); + + return 0; } State.Snapshot([&](const ZenServerState::ZenServerEntry& Entry) { ZEN_INFO("Port {} : pid {}", Entry.ListenPort, Entry.Pid); }); @@ -47,10 +49,12 @@ PsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) ZenServerState State; if (!State.InitializeReadOnly()) { - ZEN_INFO("no Zen state found"); + ZEN_CONSOLE("no Zen state found"); + + return 0; } - State.Snapshot([&](const ZenServerState::ZenServerEntry& Entry) { ZEN_INFO("Port {} : pid {}", Entry.ListenPort, Entry.Pid); }); + State.Snapshot([&](const ZenServerState::ZenServerEntry& Entry) { ZEN_CONSOLE("Port {} : pid {}", Entry.ListenPort, Entry.Pid); }); return 0; } |