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:
Matija Santl 2018-03-07 13:23:49 +01:00
parent 44aefe775e
commit 4e29b7031a

View 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();
}
};