summaryrefslogtreecommitdiff
path: root/src/libgit2/trace.c
blob: b0c56c4dc668bbeb1bc0959e14f8fd8fbc3c8c78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * 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.
 */

#include "trace.h"

#include "str.h"
#include "runtime.h"
#include "git2/trace.h"

struct git_trace_data git_trace__data = {0};

int git_trace_set(git_trace_level_t level, git_trace_cb callback)
{
	GIT_ASSERT_ARG(level == 0 || callback != NULL);

	git_trace__data.level = level;
	git_trace__data.callback = callback;
	GIT_MEMORY_BARRIER;

	return 0;
}