@@ -184,68 +184,6 @@ bool isVeryFirstRun()
184
184
return firstRun;
185
185
}
186
186
187
- static void saiLoglevelNotify (
188
- _In_ std::string strApi,
189
- _In_ std::string strLogLevel)
190
- {
191
- SWSS_LOG_ENTER ();
192
-
193
- try
194
- {
195
- sai_log_level_t logLevel;
196
- sai_deserialize_log_level (strLogLevel, logLevel);
197
-
198
- sai_api_t api;
199
- sai_deserialize_api (strApi, api);
200
-
201
- sai_status_t status = g_vendorSai->logSet (api, logLevel);
202
-
203
- if (status == SAI_STATUS_SUCCESS)
204
- {
205
- SWSS_LOG_NOTICE (" Setting SAI loglevel %s on %s" , strLogLevel.c_str (), strApi.c_str ());
206
- }
207
- else
208
- {
209
- SWSS_LOG_INFO (" set loglevel failed: %s" , sai_serialize_status (status).c_str ());
210
- }
211
- }
212
- catch (const std::exception & e)
213
- {
214
- SWSS_LOG_ERROR (" Failed to set loglevel to %s on %s: %s" ,
215
- strLogLevel.c_str (),
216
- strApi.c_str (),
217
- e.what ());
218
- }
219
- }
220
-
221
- void set_sai_api_loglevel ()
222
- {
223
- SWSS_LOG_ENTER ();
224
-
225
- // We start from 1 since 0 is SAI_API_UNSPECIFIED.
226
-
227
- for (uint32_t idx = 1 ; idx < sai_metadata_enum_sai_api_t .valuescount ; ++idx)
228
- {
229
- // TODO std::function<void(void)> f = std::bind(&Foo::doSomething, this);
230
- swss::Logger::linkToDb (
231
- sai_metadata_enum_sai_api_t .valuesnames [idx],
232
- saiLoglevelNotify,
233
- sai_serialize_log_level (SAI_LOG_LEVEL_NOTICE));
234
- }
235
- }
236
-
237
- void set_sai_api_log_min_prio (const std::string &prioStr)
238
- {
239
- SWSS_LOG_ENTER ();
240
-
241
- // We start from 1 since 0 is SAI_API_UNSPECIFIED.
242
-
243
- for (uint32_t idx = 1 ; idx < sai_metadata_enum_sai_api_t .valuescount ; ++idx)
244
- {
245
- const auto & api_name = sai_metadata_enum_sai_api_t .valuesnames [idx];
246
- saiLoglevelNotify (api_name, prioStr);
247
- }
248
- }
249
187
250
188
void timerWatchdogCallback (
251
189
_In_ int64_t span)
@@ -276,8 +214,6 @@ void redisClearRidToVidMap()
276
214
*/
277
215
bool enableRefernceCountLogs = false ;
278
216
279
- extern std::shared_ptr<Syncd> g_syncd;
280
-
281
217
int syncd_main (int argc, char **argv)
282
218
{
283
219
swss::Logger::getInstance ().setMinPrio (swss::Logger::SWSS_DEBUG);
@@ -286,8 +222,6 @@ int syncd_main(int argc, char **argv)
286
222
287
223
swss::Logger::getInstance ().setMinPrio (swss::Logger::SWSS_NOTICE);
288
224
289
- set_sai_api_loglevel ();
290
-
291
225
swss::Logger::linkToDbNative (" syncd" ); // TODO fix also in discovery
292
226
293
227
swss::WarmStart::initialize (" syncd" , " syncd" );
0 commit comments