Skip to content

Commit

Permalink
[agent] refine booting logs (#1365)
Browse files Browse the repository at this point in the history
Use `NOTE` log level instead of `INFO` since the log information is
important.
  • Loading branch information
simonlingoogle committed May 10, 2022
1 parent 5450ed1 commit 5d7c91c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/agent/main.cpp
Expand Up @@ -26,6 +26,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#define OTBR_LOG_TAG "AGENT"

#include <openthread-br/config.h>

#include <fstream>
Expand Down Expand Up @@ -117,19 +119,17 @@ static otbrLogLevel GetDefaultLogLevel(void)
return level;
}

static void PrintRadioVersion(otInstance *aInstance)
{
printf("%s\n", otPlatRadioGetVersionString(aInstance));
}

static void PrintRadioVersionAndExit(const std::vector<const char *> &aRadioUrls)
{
otbr::Ncp::ControllerOpenThread ncpOpenThread{/* aInterfaceName */ "", aRadioUrls, /* aBackboneInterfaceName */ "",
/* aDryRun */ true};
const char * radioVersion;

ncpOpenThread.Init();

PrintRadioVersion(ncpOpenThread.GetInstance());
radioVersion = otPlatRadioGetVersionString(ncpOpenThread.GetInstance());
otbrLogNotice("Radio version: %s", radioVersion);
printf("%s\n", radioVersion);

ncpOpenThread.Deinit();

Expand Down Expand Up @@ -192,14 +192,14 @@ static int realmain(int argc, char *argv[])
}

otbrLogInit(kSyslogIdent, logLevel, verbose);
otbrLogInfo("Running %s", OTBR_PACKAGE_VERSION);
otbrLogInfo("Thread version: %s", otbr::Ncp::ControllerOpenThread::GetThreadVersion());
otbrLogInfo("Thread interface: %s", interfaceName);
otbrLogInfo("Backbone interface: %s", backboneInterfaceName);
otbrLogNotice("Running %s", OTBR_PACKAGE_VERSION);
otbrLogNotice("Thread version: %s", otbr::Ncp::ControllerOpenThread::GetThreadVersion());
otbrLogNotice("Thread interface: %s", interfaceName);
otbrLogNotice("Backbone interface: %s", backboneInterfaceName);

for (int i = optind; i < argc; i++)
{
otbrLogInfo("Radio URL: %s", argv[i]);
otbrLogNotice("Radio URL: %s", argv[i]);
radioUrls.push_back(argv[i]);
}

Expand Down

0 comments on commit 5d7c91c

Please sign in to comment.