diff options
author | Jack Lloyd <[email protected]> | 2018-07-24 15:43:51 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-07-24 15:43:51 -0400 |
commit | 68a7450b87020393020f5efc98bd9d5bf5acd629 (patch) | |
tree | aa98463638006737509bb97f92d046cfed529485 /src/lib | |
parent | d24cca944011863f6afe0b5be8fb2678128947aa (diff) |
Only print FFI exceptions to stdout if an env var is set
So debugging is possible but default is silent.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/ffi/ffi.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/ffi/ffi.cpp b/src/lib/ffi/ffi.cpp index 74c576631..48b9cf803 100644 --- a/src/lib/ffi/ffi.cpp +++ b/src/lib/ffi/ffi.cpp @@ -16,7 +16,10 @@ namespace Botan_FFI { int ffi_error_exception_thrown(const char* func_name, const char* exn, int rc) { - fprintf(stderr, "in %s exception '%s' returning %d\n", func_name, exn, rc); + if(std::getenv("BOTAN_FFI_PRINT_EXCEPTIONS")) + { + std::fprintf(stderr, "in %s exception '%s' returning %d\n", func_name, exn, rc); + } return rc; } |