4557 ndc thread local (#4682)

* fix(NestedDiagnosticContext): NDC crashed in multi-thread environment

* fix(NestedDiagnosticContext): TestCase output redirect

* enh(NestedDiagnosticContext): replace Poco::ThreadLocal to C++ standard thread_local so that objects can dtor when thread exit

* enh(NestedDiagnosticContext): remove unused header files

* chore(NDCTest): verify dump content

* chore(NDCTest): use __FILE__ macro

* fix(NDCTest): fix codeql warning

* fix(NDCTest): remove temp code

* enh(NestedDiagnosticContext): add nameOnly for dump

---------

Co-authored-by: Alex Fabijanic <alex@pocoproject.org>
This commit is contained in:
siren186
2024-09-12 18:26:49 +08:00
committed by GitHub
parent b85b49643e
commit 71a9bdafbd
4 changed files with 79 additions and 10 deletions

View File

@@ -89,9 +89,11 @@ public:
/// to the given stream. The entries are delimited by
/// a newline.
void dump(std::ostream& ostr, const std::string& delimiter) const;
void dump(std::ostream& ostr, const std::string& delimiter, bool nameOnly = false) const;
/// Dumps the stack (including line number and filenames)
/// to the given stream.
/// If nameOnly is false (default), the whole path to file is printed,
/// otherwise only the file name.
void clear();
/// Clears the NDC stack.