Skip to content

Commit

Permalink
Shell: Hide job times behind SHELL_JOB_DEBUG flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ADKaster committed May 20, 2021
1 parent 70805f4 commit c22ba0d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 4 additions & 0 deletions AK/Debug.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@
#cmakedefine01 JOB_DEBUG
#endif

#ifndef SHELL_JOB_DEBUG
#cmakedefine01 SHELL_JOB_DEBUG
#endif

#ifndef JPG_DEBUG
#cmakedefine01 JPG_DEBUG
#endif
Expand Down
1 change: 1 addition & 0 deletions Meta/CMake/all_the_debug_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ set(CRYPTO_DEBUG ON)
set(DWARF_DEBUG ON)
set(HUNKS_DEBUG ON)
set(JOB_DEBUG ON)
set(SHELL_JOB_DEBUG ON)
set(GIF_DEBUG ON)
set(JPG_DEBUG ON)
set(EMOJI_DEBUG ON)
Expand Down
8 changes: 2 additions & 6 deletions Userland/Shell/Job.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "Execution.h"
#include "Forward.h"
#include <AK/Debug.h>
#include <AK/Function.h>
#include <AK/JsonObject.h>
#include <AK/JsonValue.h>
Expand All @@ -16,11 +17,6 @@
#include <LibCore/ElapsedTimer.h>
#include <LibCore/Object.h>

#define JOB_TIME_INFO
#ifndef __serenity__
# undef JOB_TIME_INFO
#endif

namespace Shell {

struct LocalFrame;
Expand All @@ -31,7 +27,7 @@ class Job : public RefCounted<Job> {

~Job()
{
#ifdef JOB_TIME_INFO
#if SHELL_JOB_DEBUG
if (m_active) {
auto elapsed = m_command_timer.elapsed();
// Don't mistake this for the command!
Expand Down

0 comments on commit c22ba0d

Please sign in to comment.