Skip to content

Commit

Permalink
Merge pull request #342 from benfred/develop
Browse files Browse the repository at this point in the history
Don't write out debug messages on shutdown
  • Loading branch information
Leonid Boytsov authored and GitHub committed Aug 6, 2018
2 parents 727648b + 870ba57 commit 63d363d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python_bindings/nmslib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,12 @@ class PythonLogger
inner.attr("critical")(message);
break;
}
} catch (const std::exception & e) {
std::cerr << "Failed to log '" << message << "'. Exception:" << e.what() << std::endl;
} catch (...) {
std::cerr << "Failed to log '" << message << "'" << std::endl;
// This is almost certainly due to python process shut down.
// Just write the message out to stderr if its not a debug message
if (severity != LIB_DEBUG) {
StdErrLogger().log(severity, file, line, function, message);
}
}
}
};
Expand Down

0 comments on commit 63d363d

Please sign in to comment.