- if (logoption & XLOG_OPTION_SECURE)
- snprintf(tmpBuf, BUF_LEN, "(%s) > [SECURE_LOG] [%s]%s", ostr[loglevel], (name)?name:"", f);
- else
- snprintf(tmpBuf, BUF_LEN, "(%s) [%s]%s", ostr[loglevel], (name)?name:"", f);
+ if( !dlog_enable )
+ {
+ /* get local time from tv */
+ gettimeofday(&tv, NULL);
+ tm = localtime(&tv.tv_sec);
+
+ /* write to file */
+ if (logoption & XLOG_OPTION_SECURE)
+ snprintf(tmpBuf, BUF_LEN, "[%s %d %02d:%02d:%02d:%03ld] (%s) > [SECURE_LOG] [%s]%s", st_month[tm->tm_mon], tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, tv.tv_usec/1000, ostr[loglevel], (name)?name:"", f);
+ else
+ snprintf(tmpBuf, BUF_LEN, "[%s %d %02d:%02d:%02d:%03ld] (%s) [%s]%s", st_month[tm->tm_mon], tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, tv.tv_usec/1000, ostr[loglevel], (name)?name:"", f);