aboutsummaryrefslogtreecommitdiffstats
path: root/src/direct_bt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-10-14 21:46:14 +0200
committerSven Gothel <[email protected]>2020-10-14 21:46:14 +0200
commit659097801be56a7c7c06bf97e14416e1e6cb9725 (patch)
tree852e20d58da65321f3e639bddd5022269197e52a /src/direct_bt
parent68ba75dc27817ac50cd1c9ae078bf36e09dedd76 (diff)
Add DBTEnv::DEBUG_JNI 'direct_bt.debug.jni' for JNI only related DBG_JNI_PRINT(); IRQ_PRINT(..) shall not print_backtrace().
Diffstat (limited to 'src/direct_bt')
-rw-r--r--src/direct_bt/DBTEnv.cpp1
-rw-r--r--src/direct_bt/dbt_debug.cpp6
2 files changed, 5 insertions, 2 deletions
diff --git a/src/direct_bt/DBTEnv.cpp b/src/direct_bt/DBTEnv.cpp
index 82a4fd93..ed05837a 100644
--- a/src/direct_bt/DBTEnv.cpp
+++ b/src/direct_bt/DBTEnv.cpp
@@ -230,6 +230,7 @@ bool DBTEnv::getExplodingProperties(const std::string & prefixDomain) noexcept {
DBTEnv::DBTEnv() noexcept
: DEBUG( getExplodingProperties("direct_bt.debug") ),
+ DEBUG_JNI( getBooleanProperty("direct_bt.debug.jni", false) ),
VERBOSE( getExplodingProperties("direct_bt.verbose") || DBTEnv::DEBUG )
{
}
diff --git a/src/direct_bt/dbt_debug.cpp b/src/direct_bt/dbt_debug.cpp
index e3c923db..7ba778e3 100644
--- a/src/direct_bt/dbt_debug.cpp
+++ b/src/direct_bt/dbt_debug.cpp
@@ -122,7 +122,7 @@ void direct_bt::ERR_PRINTv(const char *func, const char *file, const int line, c
direct_bt::print_backtrace(2);
}
-void direct_bt::ERR_PRINT_impl(const char *prefix, const char *func, const char *file, const int line, const char * format, ...) noexcept {
+void direct_bt::ERR_PRINT_impl(const char *prefix, const bool backtrace, const char *func, const char *file, const int line, const char * format, ...) noexcept {
fprintf(stderr, "[%'9" PRIu64 "] %s @ %s:%d %s: ", DBTEnv::getElapsedMillisecond(), prefix, file, line, func);
va_list args;
va_start (args, format);
@@ -130,7 +130,9 @@ void direct_bt::ERR_PRINT_impl(const char *prefix, const char *func, const char
va_end (args);
fprintf(stderr, "; last errno %d %s\n", errno, strerror(errno));
fflush(stderr);
- direct_bt::print_backtrace(2);
+ if( backtrace ) {
+ direct_bt::print_backtrace(2);
+ }
}
void direct_bt::WARN_PRINTv(const char *func, const char *file, const int line, const char * format, va_list args) noexcept {