summaryrefslogtreecommitdiff
path: root/include/ejabberd_stacktrace.hrl
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2018-12-13 11:45:45 +0100
committerPaweł Chmielowski <pchmielowski@process-one.net>2018-12-13 11:46:53 +0100
commitc88a2d056968254cdb513d81e133d45484a6236a (patch)
tree938033a3e7c5dae5b1e1edefc8d5dafeacb50efe /include/ejabberd_stacktrace.hrl
parentAdd HTTP listener on port 5280 for admin web interface (diff)
Add code for handling deprecations of get_stacktrace()
Diffstat (limited to 'include/ejabberd_stacktrace.hrl')
-rw-r--r--include/ejabberd_stacktrace.hrl27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/ejabberd_stacktrace.hrl b/include/ejabberd_stacktrace.hrl
new file mode 100644
index 00000000..470abed1
--- /dev/null
+++ b/include/ejabberd_stacktrace.hrl
@@ -0,0 +1,27 @@
+%%%----------------------------------------------------------------------
+%%%
+%%% ejabberd, Copyright (C) 2002-2018 ProcessOne
+%%%
+%%% This program is free software; you can redistribute it and/or
+%%% modify it under the terms of the GNU General Public License as
+%%% published by the Free Software Foundation; either version 2 of the
+%%% License, or (at your option) any later version.
+%%%
+%%% This program is distributed in the hope that it will be useful,
+%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
+%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+%%% General Public License for more details.
+%%%
+%%% You should have received a copy of the GNU General Public License along
+%%% with this program; if not, write to the Free Software Foundation, Inc.,
+%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+%%%
+%%%----------------------------------------------------------------------
+
+-ifdef(DEPRECATED_GET_STACKTRACE).
+-define(EX_RULE(Class, Reason, Stack), Class:Reason:Stack).
+-define(EX_STACK(Stack), Stack).
+-else.
+-define(EX_RULE(Class, Reason, _), Class:Reason).
+-define(EX_STACK(_), erlang:get_stacktrace()).
+-endif.