@@ -14,36 +14,37 @@ namespace impl {
14
14
class TRTorchPluginRegistry {
15
15
public:
16
16
TRTorchPluginRegistry () {
17
- trtorch_logger.log (util::logging::LogLevel::kINFO , " Instatiated the TRTorch plugin registry class" );
18
17
// register libNvInferPlugins and TRTorch plugins
19
18
// trtorch_logger logging level is set to kERROR and reset back to kDEBUG.
20
19
// This is because initLibNvInferPlugins initializes only a subset of plugins and logs them.
21
20
// Plugins outside this subset in TensorRT are not being logged in this. So temporarily we disable this to prevent
22
21
// multiple logging of same plugins. To provide a clear list of all plugins, we iterate through getPluginRegistry()
23
22
// where it prints the list of all the plugins registered in TensorRT with their namespaces.
24
- trtorch_logger .set_reportable_log_level (util::logging::LogLevel::kERROR );
25
- initLibNvInferPlugins (&trtorch_logger , " " );
26
- trtorch_logger .set_reportable_log_level (util::logging::LogLevel:: kDEBUG );
23
+ plugin_logger .set_reportable_log_level (util::logging::LogLevel::kERROR );
24
+ initLibNvInferPlugins (&plugin_logger , " " );
25
+ plugin_logger .set_reportable_log_level (util::logging::get_logger (). get_reportable_log_level () );
27
26
28
27
int numCreators = 0 ;
29
28
auto pluginsList = getPluginRegistry ()->getPluginCreatorList (&numCreators);
30
29
for (int k = 0 ; k < numCreators; ++k) {
31
30
if (!pluginsList[k]) {
32
- trtorch_logger .log (util::logging::LogLevel::kDEBUG , " Plugin creator for plugin " + str (k) + " is a nullptr" );
31
+ plugin_logger .log (util::logging::LogLevel::kDEBUG , " Plugin creator for plugin " + str (k) + " is a nullptr" );
33
32
continue ;
34
33
}
35
34
std::string pluginNamespace = pluginsList[k]->getPluginNamespace ();
36
- trtorch_logger .log (
35
+ plugin_logger .log (
37
36
util::logging::LogLevel::kDEBUG ,
38
37
" Registered plugin creator - " + std::string (pluginsList[k]->getPluginName ()) +
39
38
" , Namespace: " + pluginNamespace);
40
39
}
41
- trtorch_logger .log (util::logging::LogLevel::kDEBUG , " Total number of plugins registered: " + str (numCreators));
40
+ plugin_logger .log (util::logging::LogLevel::kDEBUG , " Total number of plugins registered: " + str (numCreators));
42
41
}
43
42
44
43
public:
45
- util::logging::TRTorchLogger trtorch_logger =
46
- util::logging::TRTorchLogger (" [TRTorch Plugins Context] - " , util::logging::LogLevel::kDEBUG , true );
44
+ util::logging::TRTorchLogger plugin_logger = util::logging::TRTorchLogger(
45
+ " [TRTorch Plugins Context] - " ,
46
+ util::logging::get_logger ().get_reportable_log_level(),
47
+ util::logging::get_logger().get_is_colored_output_on());
47
48
};
48
49
49
50
namespace {
0 commit comments