]>
git.proxmox.com Git - libgit2.git/blob - include/git2/trace.h
f9b4d6ff67b9c28ff196e2d2232001343ec4bbf0
2 * Copyright (C) the libgit2 contributors. All rights reserved.
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
7 #ifndef INCLUDE_git_trace_h__
8 #define INCLUDE_git_trace_h__
15 * @brief Git tracing configuration routines
16 * @defgroup git_trace Git tracing configuration routines
23 * Available tracing levels. When tracing is set to a particular level,
24 * callers will be provided tracing at the given level and all lower levels.
27 /** No tracing will be performed. */
30 /** Severe errors that may impact the program's execution */
33 /** Errors that do not impact the program's execution */
36 /** Warnings that suggest abnormal data */
39 /** Informational messages about program execution */
42 /** Detailed data that allows for debugging */
45 /** Exceptionally detailed debugging data */
50 * An instance for a tracing function
52 typedef void (*git_trace_callback
)(git_trace_level_t level
, const char *msg
);
55 * Sets the system tracing configuration to the specified level with the
56 * specified callback. When system events occur at a level equal to, or
57 * lower than, the given level they will be reported to the given callback.
59 * @param level Level to set tracing to
60 * @param cb Function to call with trace data
61 * @return 0 or an error code
63 GIT_EXTERN(int) git_trace_set(git_trace_level_t level
, git_trace_callback cb
);