mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-08 18:40:03 +08:00
fix[os_log]: Modify default log option for linux
LOG_PERROR: Directs output to stderr stream. LOG_CONS: Fallback to /dev/console only when syslogd is unavailable. The syslogd maybe unavailable in linux os. Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com> Change-Id: Iae95f7df9e6ed3f7e8ce15accce6fae5a65f2fef
This commit is contained in:
@@ -39,13 +39,18 @@ static SyslogWrapper syslog_wrapper;
|
||||
|
||||
SyslogWrapper::SyslogWrapper()
|
||||
{
|
||||
int option = LOG_PID | LOG_CONS;
|
||||
RK_U32 syslog_perror = 0;
|
||||
int option = LOG_PID;
|
||||
RK_U32 syslog_perror = 1;
|
||||
RK_U32 syslog_cons = 0;
|
||||
|
||||
os_get_env_u32("mpp_syslog_perror", &syslog_perror, 0);
|
||||
os_get_env_u32("mpp_syslog_perror", &syslog_perror, 1);
|
||||
if (syslog_perror)
|
||||
option |= LOG_PERROR;
|
||||
|
||||
os_get_env_u32("mpp_syslog_cons", &syslog_cons, 0);
|
||||
if (syslog_cons)
|
||||
option |= LOG_CONS;
|
||||
|
||||
openlog("mpp", option, LOG_USER);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user