mirror of
https://github.com/espressif/openthread.git
synced 2026-08-25 11:49:51 +00:00
[posix-host] set logging level early (#4408)
This commit sets logging level just after parsing command line arguments so that dying messages during initialization can be printed.
This commit is contained in:
+1
-3
@@ -193,10 +193,9 @@ static otInstance *InitInstance(int aArgCount, char *aArgVector[])
|
||||
|
||||
ParseArg(aArgCount, aArgVector, &config);
|
||||
|
||||
#if OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED
|
||||
openlog(aArgVector[0], LOG_PID | (config.mIsVerbose ? LOG_PERROR : 0), LOG_DAEMON);
|
||||
setlogmask(setlogmask(0) & LOG_UPTO(LOG_DEBUG));
|
||||
#endif
|
||||
otLoggingSetLevel(config.mLogLevel);
|
||||
|
||||
instance = otSysInit(&config.mPlatformConfig);
|
||||
|
||||
@@ -210,7 +209,6 @@ static otInstance *InitInstance(int aArgCount, char *aArgVector[])
|
||||
exit(OT_EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
otLoggingSetLevel(config.mLogLevel);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user