Переглянути джерело

* logging API updated (see doc/logging-api.txt for details)

  - LOG(LEVEL, FMT, ARGS...) and the short macro corresponding to
    LEVEL level made eqvivalent (eg. LOG(L_DBG, FMT, ARGS...) and
    DBG(FMT, ARGS...) prints always the same message)

  - changed the format of log messages produced by the macros
    to include the log level, module name, filename, line (if applicable)

  - added new, internal LOG_(LEVEL, PREFIX, FORMAT, ARGS...) macro

  - removed DPrint() and DEBUG() macros, L_DEFAULT log level and dprint()
    function

!!!
!!! IMPORTANT! READ ME!
!!!

These changes (mainly the first two) require reformating of the most log
messages in SER core and module source files.  This step can be done
automatically by running "scripts/logging/fix-logs-all" script BUT it
was NOT originally performed because it would have generated too many
changes in CVS which was discouraged by Andrei.  Instead, the developers
are expected to run it when ready.
Ondrej Martinek 16 роки тому
батько
коміт
6d5122540d
1 змінених файлів з 2 додано та 2 видалено
  1. 2 2
      modules_s/xlog/xlog.c

+ 2 - 2
modules_s/xlog/xlog.c

@@ -141,7 +141,7 @@ static int xlog(struct sip_msg* msg, char* lev, char* frm)
 		return -1;
 
 	/* log_buf[log_len] = '\0'; */
-	LOG(level, "%.*s", log_len, log_buf);
+	LOG_(level, "<script>: ", "%.*s", log_len, log_buf);
 
 	return 1;
 }
@@ -158,7 +158,7 @@ static int xdbg(struct sip_msg* msg, char* frm, char* str2)
 		return -1;
 
 	/* log_buf[log_len] = '\0'; */
-	DBG("%.*s", log_len, log_buf);
+	LOG_(L_DBG, "<script>: ", "%.*s", log_len, log_buf);
 
 	return 1;
 }