[posix] log version on start (#4620)

This commit is contained in:
Yakun Xu
2020-03-06 20:04:10 -08:00
committed by GitHub
parent a75b412ecf
commit d77292ccc4
+7
View File
@@ -58,6 +58,7 @@
#include <openthread/diag.h>
#include <openthread/logging.h>
#include <openthread/tasklet.h>
#include <openthread/thread.h>
#include <openthread/platform/radio.h>
#if OPENTHREAD_POSIX_APP_TYPE == OPENTHREAD_POSIX_APP_TYPE_NCP
#include <openthread/ncp.h>
@@ -305,6 +306,8 @@ static otInstance *InitInstance(int aArgCount, char *aArgVector[])
openlog(aArgVector[0], LOG_PID | (config.mIsVerbose ? LOG_PERROR : 0), LOG_DAEMON);
setlogmask(setlogmask(0) & LOG_UPTO(LOG_DEBUG));
syslog(LOG_INFO, "Running %s", otGetVersionString());
syslog(LOG_INFO, "Thread version: %hu", otThreadGetVersion());
otLoggingSetLevel(config.mLogLevel);
instance = otSysInit(&config.mPlatformConfig);
@@ -313,6 +316,10 @@ static otInstance *InitInstance(int aArgCount, char *aArgVector[])
{
printf("%s\n", otPlatRadioGetVersionString(instance));
}
else
{
syslog(LOG_INFO, "RCP version: %s", otPlatRadioGetVersionString(instance));
}
if (config.mIsDryRun)
{