LAPP 打印服务 支持条码打印和表单打印 通过Socket或windows打印方式
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
296 B

  1. package glog
  2. import (
  3. "os"
  4. "syscall"
  5. //"log"
  6. )
  7. func RecordFatal(file string) {
  8. logFile, err := os.OpenFile(EnsureFilePath(file), os.O_CREATE|os.O_APPEND|os.O_WRONLY|os.O_SYNC, 0660)
  9. if err != nil {
  10. println(err.Error())
  11. return
  12. }
  13. syscall.Dup2(int(logFile.Fd()), int(os.Stderr.Fd()))
  14. }