deps/libgit2/src/libgit2/trace.h

filter: Statementstmt 0.0% 0 / 14 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 18 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« deps/libgit2/src/libgit2/trace.c ↑ Summary deps/libgit2/src/libgit2/transports/auth.c »
1 /*
2 * Copyright (C) the libgit2 contributors. All rights reserved.
3 *
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.
6 */
7 #ifndef INCLUDE_trace_h__
8 #define INCLUDE_trace_h__
9  
10 #include "common.h"
11  
12 #include <git2/trace.h>
13 #include "str.h"
14  
15 struct git_trace_data {
16 git_trace_level_t level;
17 git_trace_cb callback;
18 };
19  
20 extern struct git_trace_data git_trace__data;
21  
22 0 GIT_INLINE(void) git_trace__write_fmt(
23 git_trace_level_t level,
24 const char *fmt,
25 va_list ap)
26 {
27 0 git_trace_cb callback = git_trace__data.callback;
28 0 git_str message = GIT_STR_INIT;
29  
30 0 git_str_vprintf(&message, fmt, ap);
31  
32 0 callback(level, git_str_cstr(&message));
33  
34 0 git_str_dispose(&message);
35 0 }
36  
37 #define git_trace_level() (git_trace__data.level)
38  
39 0 GIT_INLINE(void) git_trace(git_trace_level_t level, const char *fmt, ...)
40 {
41 0 ▶ if (git_trace__data.level >= level &&
Branch: 1 branch
BranchTrueFalseTotal
if (git_trace__data.level >= level && 0 0 0
42 0 ▶ git_trace__data.callback != NULL) {
Branch: 1 branch
BranchTrueFalseTotal
git_trace__data.callback != NULL) { 0 0 0
43 va_list ap;
44  
45 0 va_start(ap, fmt);
46 0 git_trace__write_fmt(level, fmt, ap);
47 0 va_end(ap);
48 }
49 0 }
50  
51 #endif
« deps/libgit2/src/libgit2/trace.c ↑ Summary deps/libgit2/src/libgit2/transports/auth.c »