| 31 | |
| 32 | template <ILogger::Severity kSeverity> |
| 33 | int32_t LogStream<kSeverity>::Buf::sync() |
| 34 | { |
| 35 | std::string s = str(); |
| 36 | while (!s.empty() && s.back() == '\n') |
| 37 | { |
| 38 | s.pop_back(); |
| 39 | } |
| 40 | if (gLogger != nullptr) |
| 41 | { |
| 42 | gLogger->log(kSeverity, s.c_str()); |
| 43 | } |
| 44 | str(""); |
| 45 | return 0; |
| 46 | } |
| 47 | |
| 48 | // These use gLogger, and therefore require initLibNvInferPlugins() to be called with a logger |
| 49 | // (otherwise, it will not log) |