lite: disable debug logging

feature/tap-sh
William Pitcock 2019-05-06 15:15:41 -05:00
parent 43ca536b9f
commit 2d0c1f5cb7
3 changed files with 12 additions and 0 deletions

View File

@ -876,11 +876,13 @@ main(int argc, char *argv[])
{ NULL, 0, NULL, 0 }
};
#ifndef PKGCONF_LITE
if (getenv("PKG_CONFIG_EARLY_TRACE"))
{
error_msgout = stderr;
pkgconf_client_set_trace_handler(&pkg_client, error_handler, NULL);
}
#endif
#ifndef PKGCONF_LITE
personality = deduce_personality(argv);
@ -981,8 +983,10 @@ main(int argc, char *argv[])
if ((want_flags & PKG_VALIDATE) == PKG_VALIDATE || (want_flags & PKG_DEBUG) == PKG_DEBUG)
pkgconf_client_set_warn_handler(&pkg_client, error_handler, NULL);
#ifndef PKGCONF_LITE
if ((want_flags & PKG_DEBUG) == PKG_DEBUG)
pkgconf_client_set_trace_handler(&pkg_client, error_handler, NULL);
#endif
if ((want_flags & PKG_ABOUT) == PKG_ABOUT)
{

View File

@ -99,8 +99,10 @@ pkgconf_client_init(pkgconf_client_t *client, pkgconf_error_handler_func_t error
client->error_handler = error_handler;
client->auditf = NULL;
#ifndef PKGCONF_LITE
if (client->trace_handler == NULL)
pkgconf_client_set_trace_handler(client, NULL, NULL);
#endif
pkgconf_client_set_error_handler(client, error_handler, error_handler_data);
pkgconf_client_set_warn_handler(client, NULL, NULL);
@ -567,6 +569,7 @@ pkgconf_client_set_error_handler(pkgconf_client_t *client, pkgconf_error_handler
}
}
#ifndef PKGCONF_LITE
/*
* !doc
*
@ -607,3 +610,4 @@ pkgconf_client_set_trace_handler(pkgconf_client_t *client, pkgconf_error_handler
PKGCONF_TRACE(client, "installing default trace handler");
}
}
#endif

View File

@ -278,6 +278,7 @@ PKGCONF_API bool pkgconf_warn(const pkgconf_client_t *client, const char *format
PKGCONF_API bool pkgconf_trace(const pkgconf_client_t *client, const char *filename, size_t lineno, const char *funcname, const char *format, ...) PRINTFLIKE(5, 6);
PKGCONF_API bool pkgconf_default_error_handler(const char *msg, const pkgconf_client_t *client, const void *data);
#ifndef PKGCONF_LITE
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
#define PKGCONF_TRACE(client, ...) do { \
pkgconf_trace(client, __FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__); \
@ -287,6 +288,9 @@ PKGCONF_API bool pkgconf_default_error_handler(const char *msg, const pkgconf_cl
pkgconf_trace(client, __FILE__, __LINE__, __func__, __VA_ARGS__); \
} while (0);
#endif
#else
#define PKGCONF_TRACE(client, ...)
#endif
PKGCONF_API pkgconf_pkg_t *pkgconf_pkg_ref(pkgconf_client_t *client, pkgconf_pkg_t *pkg);
PKGCONF_API void pkgconf_pkg_unref(pkgconf_client_t *client, pkgconf_pkg_t *pkg);