Remove logging
This commit is contained in:
		
							parent
							
								
									d417fa653f
								
							
						
					
					
						commit
						f14ed3a85e
					
				
							
								
								
									
										29
									
								
								logging.go
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								logging.go
									
									
									
									
									
								
							@ -1,29 +0,0 @@
 | 
			
		||||
package main
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	loglib "log"
 | 
			
		||||
	"os"
 | 
			
		||||
	"runtime"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	logger *loglib.Logger
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func setupLogging() {
 | 
			
		||||
	logger = loglib.New(os.Stdout, "", loglib.Ldate|loglib.Lmicroseconds)
 | 
			
		||||
 | 
			
		||||
	log("Burlesque v%s started", version)
 | 
			
		||||
	log("GOMAXPROCS is set to %d", runtime.GOMAXPROCS(-1))
 | 
			
		||||
	log("Storage path: %s", config.storage)
 | 
			
		||||
	log("Server is running at http://127.0.0.1:%d", config.port)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func log(format string, args ...interface{}) {
 | 
			
		||||
	logger.Printf("[INFO]  "+format, args...)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func alert(err error, format string, args ...interface{}) {
 | 
			
		||||
	logger.Printf("[ERROR] "+format, args...)
 | 
			
		||||
	logger.Printf("        %s", err.Error())
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										8
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								main.go
									
									
									
									
									
								
							@ -2,8 +2,10 @@ package main
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"flag"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"os"
 | 
			
		||||
	"os/signal"
 | 
			
		||||
	"runtime"
 | 
			
		||||
	"syscall"
 | 
			
		||||
 | 
			
		||||
	"github.com/KosyanMedia/burlesque/hub"
 | 
			
		||||
@ -43,6 +45,10 @@ func main() {
 | 
			
		||||
		os.Exit(0)
 | 
			
		||||
	}()
 | 
			
		||||
 | 
			
		||||
	setupLogging()
 | 
			
		||||
	fmt.Println("Burlesque v%s started", version)
 | 
			
		||||
	fmt.Println("GOMAXPROCS is set to %d", runtime.GOMAXPROCS(-1))
 | 
			
		||||
	fmt.Println("Storage path: %s", config.storage)
 | 
			
		||||
	fmt.Println("Server is running at http://127.0.0.1:%d", config.port)
 | 
			
		||||
 | 
			
		||||
	startServer()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user