devmapper_log.go 459 B

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