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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-License-Identifier: Apache-2.0
package main
/*
#cgo CFLAGS: -I${SRCDIR}/include
#include "rob_abi.h"
#include <stdlib.h>
static void rob_call_log(rob_log_fn fn, void *user, int32_t level, const char *data, size_t len) {
if (fn != 0) {
fn(user, level, data, len);
}
}
*/
import "C"
import (
"strings"
"unsafe"
)
// emit is in this file so cgo can see rob_call_log. A file that uses //export
// cannot define that helper in its preamble.
func (level C.int32_t, msg string)