Initial commit
This commit is contained in:
commit
6c071192e1
12 changed files with 709 additions and 0 deletions
23
log/pkg.go
Normal file
23
log/pkg.go
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
package log
|
||||
|
||||
import (
|
||||
// Standard
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
var (
|
||||
logFile os.File
|
||||
log *bufio.Writer
|
||||
)
|
||||
|
||||
func init() {
|
||||
logFile, _ := os.OpenFile("/tmp/launcher.log", os.O_APPEND | os.O_CREATE | os.O_WRONLY, 0644)
|
||||
log = bufio.NewWriter(logFile)
|
||||
}
|
||||
|
||||
func Print(format string, params ...interface{}) {
|
||||
fmt.Fprintf(log, format+"\n", params...)
|
||||
log.Flush()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue