Changeset 1174 in svn for trunk


Ignore:
Timestamp:
2012-11-13T13:30:21+01:00 (3 years ago)
Author:
Xuefer
Message:

show basename for easier trace log reader

Location:
trunk/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/util/xc_trace.c

    r990 r1174  
     1#include "php.h"
    12#include "xc_trace.h"
    23#include <stdio.h>
    34#include <stdarg.h>
     5#include <string.h>
    46
     7const char *xc_trace_get_basename(const char *path) /* {{{ */
     8{
     9    const char *last_separator = strrchr(path, PHP_DIR_SEPARATOR);
     10    return last_separator ? last_separator + 1 : path;
     11}
     12/* }}} */
    513int xc_vtrace(const char *fmt, va_list args) /* {{{ */
    614{
  • trunk/util/xc_trace.h

    r1044 r1174  
    3333}
    3434#   else
     35const char *xc_trace_get_basename(const char *path);
    3536#       define TRACE(fmt, ...) \
    36         xc_trace("%s:%d: " fmt "\r\n", __FILE__, __LINE__, __VA_ARGS__)
     37        xc_trace("%s:%d: " fmt "\r\n", xc_trace_get_basename(__FILE__), __LINE__, __VA_ARGS__)
    3738#   endif /* ZEND_WIN32 */
    3839#   undef NDEBUG
Note: See TracChangeset for help on using the changeset viewer.