summaryrefslogtreecommitdiff
path: root/src/mongo/util/stacktrace.h
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2014-08-05 14:32:45 -0400
committerBenety Goh <benety@mongodb.com>2014-08-12 18:56:41 -0400
commita3845092f26955e6cbfca868fd136b7d5eefed9b (patch)
treedfb566b50a00b8c64002e6107d9fcbdb1443c6cf /src/mongo/util/stacktrace.h
parent0ea8cf462b48a1aeefb10fd4bba0b1e93b0e661e (diff)
downloadmongo-a3845092f26955e6cbfca868fd136b7d5eefed9b.tar.gz
SERVER-14729 logging cleanup - removed mongo/util/log.h from headers, de-inlining functions that use logging where applicable.
de-inlined BSONElement::_asCode() de-inlined BSONObjBuilder::appendDate() de-inlined DBClientCursor::nextSafe() de-inlined IndexDescriptor::_checkOk() de-inlined LastErrorHolder::getSafe() de-inlined UpdateResult constructor de-inlined QueryPlannerCommon::reverseScans() de-inlined repl::ScopedConn::connect() de-inlined repl::_MultiCommand::run() de-inlined OplogReader::tailCheck() de-inlined repl::StateBox::change() de-inlined repl::SyncSourceFeedback::_resetConnection() de-inlined DiskLoc56Bit::operator=() de-inlined DurableInterface::~DurableInterface() de-inlined ListeningSockets::closeAll() de-inlined RelativePath::fromFullPath() and getPartition() de-inlined V8Scope::checkV8ErrorState and removed debug log message from ObjTracker destructor (v8-3.25) de-inlined V8Scope::checkV8ErrorState and removed debug log message from ObjTracker destructor removed log message from List1::orphan() - this should have no user-facing impact because List1::orphan() is used in tests only removed log message from RWLockRecursiveNongreedy::Lock() removed log message from RSBase destructor removed log.h dependency from DESTRUCTOR_GUARD macro removed mongo/util/log.h dependency from qlog.h removed mongo/util/log.h dependency from stacktrace.h removed mongo/util/log.h dependency from s2 logging header removed mongo/util/log.h dependency from chunk_diff-inl.cpp removed mongo/util/log.h from pch.h removed unused mongo/util/log.h include from inlined file sorter.cpp convert HashTable<K,V> to non-template NamespaceHashTable. De-inlined NamespaceHashTable::_find() and constructor convert isself getMyAddrs()and getallIPs() debug log to use LOG() macro assign default log component MONGO_LOG_DEFAULT_COMPONENT removed unused macros LOGATMOST and LOGSOME removed unused FLOG() macro from goodies.h
Diffstat (limited to 'src/mongo/util/stacktrace.h')
-rw-r--r--src/mongo/util/stacktrace.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/mongo/util/stacktrace.h b/src/mongo/util/stacktrace.h
index 8e10932a6ab..40fa666fdaf 100644
--- a/src/mongo/util/stacktrace.h
+++ b/src/mongo/util/stacktrace.h
@@ -33,7 +33,10 @@
#include <iostream>
-#include "mongo/util/log.h"
+#include "mongo/logger/log_severity.h"
+#include "mongo/logger/logger.h"
+#include "mongo/logger/logstream_builder.h"
+#include "mongo/util/concurrency/thread_name.h"
#if defined(_WIN32)
// We need to pick up a decl for CONTEXT. Forward declaring would be preferable, but it is
@@ -43,12 +46,21 @@
namespace mongo {
+ /**
+ * Returns a log stream builder suitable for printStackTrace() default argument
+ * Do not use in any other context.
+ */
+ inline logger::LogstreamBuilder getStackTraceLogger() {
+ using namespace logger;
+ return LogstreamBuilder(globalLogDomain(), getThreadName(), LogSeverity::Log());
+ }
+
// Print stack trace information to "os", default to the log stream.
- void printStackTrace(std::ostream &os=log().stream());
+ void printStackTrace(std::ostream &os=getStackTraceLogger().stream());
#if defined(_WIN32)
// Print stack trace (using a specified stack context) to "os", default to the log stream.
- void printWindowsStackTrace(CONTEXT &context, std::ostream &os=log().stream());
+ void printWindowsStackTrace(CONTEXT &context, std::ostream &os=getStackTraceLogger().stream());
// Print error message from C runtime followed by stack trace
int crtDebugCallback(int, char* originalMessage, int*);