mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-29 22:27:13 +09:00
Reorganize file structure
This commit is contained in:
@@ -5,12 +5,15 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
// NullWriter simply sends writes into the void
|
||||
type NullWriter struct{}
|
||||
|
||||
// Write is empty
|
||||
func (NullWriter) Write(data []byte) (n int, err error) {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
// InitLog sets up the debug log system for micro if it has been enabled by compile-time variables
|
||||
func InitLog() {
|
||||
if Debug == "ON" {
|
||||
f, err := os.OpenFile("log.txt", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)
|
||||
@@ -22,6 +25,5 @@ func InitLog() {
|
||||
log.Println("Micro started")
|
||||
} else {
|
||||
log.SetOutput(NullWriter{})
|
||||
log.Println("Micro started")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user