Skip to content

Logging with zap in cgo #1219

Answered by abhinav
shanebishop asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @shanebishop, you can't log to Zap from C like that because Zap does not expose a C API. Even if Zap was able to expose C-level logging APIs, because all of Zap's logic is implemented in Go, the C environment would have to yield control back to the Go runtime for each log call, at which point this is moot again because it's vulnerable to the issues you're trying to avoid.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by shanebishop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants