devmapper_log.go 482 B

123456789101112131415
  1. // +build linux,amd64
  2. package devmapper
  3. import "C"
  4. // Due to the way cgo works this has to be in a separate file, as devmapper.go has
  5. // definitions in the cgo block, which is incompatible with using "//export"
  6. //export DevmapperLogCallback
  7. func DevmapperLogCallback(level C.int, file *C.char, line C.int, dm_errno_or_class C.int, message *C.char) {
  8. if dmLogger != nil {
  9. dmLogger.log(int(level), C.GoString(file), int(line), int(dm_errno_or_class), C.GoString(message))
  10. }
  11. }