Skip to content

Commit 379de6a

Browse files
marian-pritsaklguohan
authored andcommitted
Enable runtime loglevel setting via Redis DB (sonic-net#156)
* Enable runtime loglevel setting via Redis DB Signed-off-by: marian-pritsak <[email protected]> * Change linkToDb call to LinkToDBNative Signed-off-by: marian-pritsak <[email protected]>
1 parent 9f03518 commit 379de6a

File tree

6 files changed

+6
-7
lines changed

6 files changed

+6
-7
lines changed

fpmsyncd/fpmsyncd.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ using namespace swss;
1010

1111
int main(int argc, char **argv)
1212
{
13+
swss::Logger::linkToDbNative("fpmsyncd");
1314
DBConnector db(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
1415
RedisPipeline pipeline(&db);
1516
RouteSync sync(&pipeline);

intfsyncd/intfsyncd.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ using namespace swss;
1010

1111
int main(int argc, char **argv)
1212
{
13+
swss::Logger::linkToDbNative("intfsyncd");
1314
DBConnector db(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
1415
IntfSync sync(&db);
1516

orchagent/main.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -136,20 +136,17 @@ void initSaiApi()
136136

137137
int main(int argc, char **argv)
138138
{
139-
swss::Logger::getInstance().setMinPrio(swss::Logger::SWSS_NOTICE);
139+
swss::Logger::linkToDbNative("orchagent");
140140

141141
SWSS_LOG_ENTER();
142142

143143
int opt;
144144
sai_status_t status;
145145

146-
while ((opt = getopt(argc, argv, "m:hd")) != -1)
146+
while ((opt = getopt(argc, argv, "m:h")) != -1)
147147
{
148148
switch (opt)
149149
{
150-
case 'd':
151-
swss::Logger::getInstance().setMinPrio(swss::Logger::SWSS_DEBUG);
152-
break;
153150
case 'm':
154151
gMacAddress = MacAddress(optarg);
155152
break;

portsyncd/portsyncd.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ void handleVlanIntfFile(string file);
4747

4848
int main(int argc, char **argv)
4949
{
50+
Logger::linkToDbNative("portsyncd");
5051
int opt;
5152
string port_config_file = DEFAULT_PORT_CONFIG_FILE;
5253
string vlan_interfaces_file = DEFAULT_VLAN_INTERFACES_FILE;

swssconfig/swssconfig.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ vector<string> read_directory(const string &path)
162162

163163
int main(int argc, char **argv)
164164
{
165-
Logger::setMinPrio(Logger::SWSS_NOTICE);
166-
167165
vector<string> files;
168166
if (argc == 1)
169167
{

teamsyncd/teamsyncd.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ using namespace swss;
1111

1212
int main(int argc, char **argv)
1313
{
14+
swss::Logger::linkToDbNative("teamsyncd");
1415
DBConnector db(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
1516
Select s;
1617
TeamSync sync(&db, &s);

0 commit comments

Comments
 (0)