logging: change newline handling

pull/1578/head
Victor Julien 11 years ago
parent 1927b3000c
commit b13de5bf08

@ -156,7 +156,7 @@ static inline void SCLogPrintToStream(FILE *fd, char *msg)
SCMutexLock(&sc_log_stream_lock);
#endif /* OS_WIN32 */
if (fprintf(fd, "%s", msg) < 0)
if (fprintf(fd, "%s\n", msg) < 0)
printf("Error writing to stream using fprintf\n");
fflush(fd);
@ -196,8 +196,6 @@ static inline void SCLogPrintToSyslog(int syslog_log_level, const char *msg)
*/
static void SCLogOutputBuffer(SCLogLevel log_level, char *msg)
{
char *temp = msg;
int len = strlen(msg);
SCLogOPIfaceCtx *op_iface_ctx = NULL;
#define MAX_SUBSTRINGS 30
@ -209,15 +207,6 @@ static void SCLogOutputBuffer(SCLogLevel log_level, char *msg)
return;
}
/* We need to add a \n for our messages, before logging them. If the
* messages have hit the 1023 length limit, strip the message to
* accomodate the \n */
if (len == SC_LOG_MAX_LOG_MSG_LEN - 1)
len = SC_LOG_MAX_LOG_MSG_LEN - 2;
temp[len] = '\n';
temp[len + 1] = '\0';
if (sc_log_config->op_filter_regex != NULL) {
if (pcre_exec(sc_log_config->op_filter_regex,
sc_log_config->op_filter_regex_study,

Loading…
Cancel
Save