Skip to content

Commit

Permalink
Revert changes to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
kinkie committed Aug 9, 2024
1 parent 78d2448 commit 9bb3ed0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
12 changes: 2 additions & 10 deletions src/acl/external/time_quota/ext_time_quota_acl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ int main(int argc, char **argv)

program_name = argv[0];
Debug::NameThisHelper("ext_time_quota_acl");
char *cacheLog = nullptr;

while ((opt = getopt(argc, argv, "dp:b:h")) != -1) {
switch (opt) {
Expand All @@ -366,15 +365,8 @@ int main(int argc, char **argv)
}
}

if (cacheLog) {
Debug::cache_log = cacheLog;
Debug::doNotCloseOnExec = true;
Debug::UseCacheLog();
Debug::ResetStderrLevel(DBG_CRITICAL); // stop debugging to stderr
// debug levels are reset by UseCacheLog
if (debug)
Debug::Levels[MY_DEBUG_SECTION] = DBG_DATA;
}
if (debug)
Debug::Levels[MY_DEBUG_SECTION] = DBG_DATA;

debugs(MY_DEBUG_SECTION, DBG_IMPORTANT, "Starting " << program_name);
setbuf(stdout, nullptr);
Expand Down
1 change: 0 additions & 1 deletion src/debug/Stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class Debug
static int Levels[MAX_DEBUG_SECTIONS];
static int override_X;
static bool log_syslog;
static bool doNotCloseOnExec;

// TODO: Convert all helpers to use debugs() and NameThisHelper() APIs.
/// Use the given name for debugs() messages from this helper process.
Expand Down
4 changes: 1 addition & 3 deletions src/debug/debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
char *Debug::debugOptions = nullptr;
int Debug::override_X = 0;
bool Debug::log_syslog = false;
bool Debug::doNotCloseOnExec = false;
int Debug::Levels[MAX_DEBUG_SECTIONS];
char *Debug::cache_log = nullptr;
int Debug::rotateNumber = -1;
Expand Down Expand Up @@ -765,8 +764,7 @@ DebugFile::reset(FILE *newFile, const char *newName)
file_ = newFile; // may be nil

if (file_) {
if (!Debug::doNotCloseOnExec)
commSetCloseOnExec(fileno(file_));
commSetCloseOnExec(fileno(file_));
fd_open(fileno(file_), FD_LOG, Debug::cache_log);
}

Expand Down

0 comments on commit 9bb3ed0

Please sign in to comment.