Sha256: dc582e64181bbd55683b5afa6b400c9729a8daff22571c0ace7a3aada3b179bf

Contents?: true

Size: 1.04 KB

Versions: 12

Compression:

Stored size: 1.04 KB

Contents

/*
 * Copyright (C) the libgit2 contributors. All rights reserved.
 *
 * This file is part of libgit2, distributed under the GNU GPL v2 with
 * a Linking Exception. For full terms see the included COPYING file.
 */
#ifndef INCLUDE_trace_h__
#define INCLUDE_trace_h__

#include "common.h"

#include <git2/trace.h>
#include "str.h"

struct git_trace_data {
	git_trace_level_t level;
	git_trace_cb callback;
};

extern struct git_trace_data git_trace__data;

GIT_INLINE(void) git_trace__write_fmt(
	git_trace_level_t level,
	const char *fmt,
	va_list ap)
{
	git_trace_cb callback = git_trace__data.callback;
	git_str message = GIT_STR_INIT;

	git_str_vprintf(&message, fmt, ap);

	callback(level, git_str_cstr(&message));

	git_str_dispose(&message);
}

#define git_trace_level()	(git_trace__data.level)

GIT_INLINE(void) git_trace(git_trace_level_t level, const char *fmt, ...)
{
	if (git_trace__data.level >= level &&
	    git_trace__data.callback != NULL) {
		va_list ap;

		va_start(ap, fmt);
		git_trace__write_fmt(level, fmt, ap);
		va_end(ap);
	}
}

#endif

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rugged-1.7.2 vendor/libgit2/src/libgit2/trace.h
rugged-1.6.5 vendor/libgit2/src/libgit2/trace.h
rugged-1.7.1 vendor/libgit2/src/libgit2/trace.h
rugged-1.6.3 vendor/libgit2/src/libgit2/trace.h
rugged-1.6.2 vendor/libgit2/src/libgit2/trace.h
rugged-1.5.1 vendor/libgit2/src/libgit2/trace.h
rugged-1.4.5 vendor/libgit2/src/trace.h
rugged-1.5.0.1 vendor/libgit2/src/libgit2/trace.h
rugged-1.5.0 vendor/libgit2/src/libgit2/trace.h
rugged-1.4.4 vendor/libgit2/src/trace.h
rugged-1.4.3 vendor/libgit2/src/trace.h
rugged-1.4.2 vendor/libgit2/src/trace.h