]> git.proxmox.com Git - libgit2.git/blob - src/trace.c
New upstream version 1.4.3+dfsg.1
[libgit2.git] / src / trace.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
8 #include "trace.h"
9
10 #include "str.h"
11 #include "runtime.h"
12 #include "git2/trace.h"
13
14 struct git_trace_data git_trace__data = {0};
15
16 int git_trace_set(git_trace_level_t level, git_trace_cb callback)
17 {
18 GIT_ASSERT_ARG(level == 0 || callback != NULL);
19
20 git_trace__data.level = level;
21 git_trace__data.callback = callback;
22 GIT_MEMORY_BARRIER;
23
24 return 0;
25 }