Add a class that logs stacktrace on destruction
Summary: Added a class that is supposed to be used as a base class on classes where we want to see the stacktrace of destructor call. Example of the output is P7 where classes `GraphDb` and `Client` extend `LogDestructor` base. Reviewers: florijan, teon.banek Reviewed By: florijan Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1281
This commit is contained in:
parent
44aefe775e
commit
4e29b7031a
13
src/utils/log_destructor.hpp
Normal file
13
src/utils/log_destructor.hpp
Normal file
@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <glog/logging.h>
|
||||
|
||||
#include "utils/stacktrace.hpp"
|
||||
|
||||
class LogDestructor {
|
||||
protected:
|
||||
~LogDestructor() {
|
||||
Stacktrace st;
|
||||
DLOG(INFO) << st.dump();
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user