diff options
Diffstat (limited to 'include/git2/trace.h')
-rw-r--r-- | include/git2/trace.h | 43 |
1 files changed, 13 insertions, 30 deletions
diff --git a/include/git2/trace.h b/include/git2/trace.h index 867b34612..f9b4d6ff6 100644 --- a/include/git2/trace.h +++ b/include/git2/trace.h @@ -20,64 +20,47 @@ GIT_BEGIN_DECL /** - * Available tracing messages. Each tracing level can be enabled - * independently or pass GIT_TRACE_ALL to enable all levels. + * Available tracing levels. When tracing is set to a particular level, + * callers will be provided tracing at the given level and all lower levels. */ typedef enum { /** No tracing will be performed. */ - GIT_TRACE_NONE = 0x0000u, - - /** All tracing messages will be sent. */ - GIT_TRACE_ALL = 0xFFFFu, + GIT_TRACE_NONE = 0, /** Severe errors that may impact the program's execution */ - GIT_TRACE_FATAL = 0x0001u, + GIT_TRACE_FATAL = 1, /** Errors that do not impact the program's execution */ - GIT_TRACE_ERROR = 0x0002u, - GIT_TRACE_ERROR_AND_BELOW = 0x0003u, + GIT_TRACE_ERROR = 2, /** Warnings that suggest abnormal data */ - GIT_TRACE_WARN = 0x0004u, - GIT_TRACE_WARN_AND_BELOW = 0x0007u, + GIT_TRACE_WARN = 3, /** Informational messages about program execution */ - GIT_TRACE_INFO = 0x0008u, - GIT_TRACE_INFO_AND_BELOW = 0x000Fu, + GIT_TRACE_INFO = 4, /** Detailed data that allows for debugging */ - GIT_TRACE_DEBUG = 0x0010u, + GIT_TRACE_DEBUG = 5, /** Exceptionally detailed debugging data */ - GIT_TRACE_TRACE = 0x0020u, - - /** Performance tracking related traces */ - GIT_TRACE_PERF = 0x0040u, + GIT_TRACE_TRACE = 6 } git_trace_level_t; /** * An instance for a tracing function */ -typedef void (*git_trace_callback)( - git_trace_level_t level, /* just one bit will be sent */ - void *cb_payload, - void *msg_payload, - const char *msg); +typedef void (*git_trace_callback)(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 Bitmask of all enabled trace levels - * @param cb Function to call with trace messages - * @param cb_payload Payload to pass when callback is invoked + * @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_callback cb, - void *cb_payload); +GIT_EXTERN(int) git_trace_set(git_trace_level_t level, git_trace_callback cb); /** @} */ GIT_END_DECL |