* 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_git_trace_h__
#define INCLUDE_git_trace_h__
* @brief Git tracing configuration routines
* @defgroup git_trace Git tracing configuration routines
* Available tracing levels. When tracing is set to a particular level,
* callers will be provided tracing at the given level and all lower levels.
/** No tracing will be performed. */
/** Severe errors that may impact the program's execution */
/** Errors that do not impact the program's execution */
/** Warnings that suggest abnormal data */
/** Informational messages about program execution */
/** Detailed data that allows for debugging */
/** Exceptionally detailed debugging data */
* An instance for a tracing function
typedef void GIT_CALLBACK(git_trace_cb)(git_trace_level_t level, const char *msg);
* Sets the system tracing configuration to the specified level with the
* specified callback. When system events occur at a level equal to, or
* lower than, the given level they will be reported to the given callback.
* @param level Level to set tracing to
* @param cb Function to call with trace data
* @return 0 or an error code
GIT_EXTERN(int) git_trace_set(git_trace_level_t level, git_trace_cb cb);