]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/stub_debug.cc
2 * Copyright (C) 1996-2022 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
10 * A stub implementation of the Debug.h API.
11 * For use by test binaries which do not need the full context debugging
13 * Note: it doesn't use the STUB API as the functions defined here must
14 * not abort the unit test.
17 #include "debug/Stream.h"
19 #define STUB_API "debug/libdebug.la"
20 #include "tests/STUB.h"
22 char *Debug::debugOptions
;
23 char *Debug::cache_log
= nullptr;
24 int Debug::rotateNumber
= 0;
25 int Debug::Levels
[MAX_DEBUG_SECTIONS
];
26 int Debug::override_X
= 0;
27 bool Debug::log_syslog
= false;
28 void Debug::ForceAlert() STUB
30 void ResyncDebugLog(FILE *) STUB
43 Debug::LogMessage(const Context
&context
)
45 if (context
.level
> DBG_IMPORTANT
)
51 fprintf(stderr
, "%s| %s\n",
52 "stub time", // debugLogTime(squid_curtime),
53 context
.buf
.str().c_str());
56 bool Debug::StderrEnabled() STUB_RETVAL(false)
57 void Debug::PrepareToDie() STUB
60 Debug::parseOptions(char const *)
63 Debug::Context
*Debug::Current
= nullptr;
65 Debug::Context::Context(const int aSection
, const int aLevel
):
68 sectionLevel(Levels
[aSection
]),
72 buf
.setf(std::ios::fixed
);
77 Debug::Start(const int section
, const int level
)
79 Current
= new Context(section
, level
);
94 ForceAlert(std::ostream
& s
)