Explorar el Código

show basename for easier trace log reader

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1174 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer hace 8 años
padre
commit
7cd9b79490
Se han modificado 2 ficheros con 10 adiciones y 1 borrados
  1. +8
    -0
      util/xc_trace.c
  2. +2
    -1
      util/xc_trace.h

+ 8
- 0
util/xc_trace.c Ver fichero

@ -1,7 +1,15 @@
#include "php.h"
#include "xc_trace.h"
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
const char *xc_trace_get_basename(const char *path) /* {{{ */
{
const char *last_separator = strrchr(path, PHP_DIR_SEPARATOR);
return last_separator ? last_separator + 1 : path;
}
/* }}} */
int xc_vtrace(const char *fmt, va_list args) /* {{{ */
{
return vfprintf(stderr, fmt, args);


+ 2
- 1
util/xc_trace.h Ver fichero

@ -32,8 +32,9 @@ static inline int TRACE(const char *fmt, ...)
return ret;
}
# else
const char *xc_trace_get_basename(const char *path);
# define TRACE(fmt, ...) \
xc_trace("%s:%d: " fmt "\r\n", __FILE__, __LINE__, __VA_ARGS__)
xc_trace("%s:%d: " fmt "\r\n", xc_trace_get_basename(__FILE__), __LINE__, __VA_ARGS__)
# endif /* ZEND_WIN32 */
# undef NDEBUG
# undef inline


Cargando…
Cancelar
Guardar