1
0
Fork 0
forked from External/ergo

Make debugging messages easier to turn off.

This commit is contained in:
Jeremy Latt 2013-05-11 14:43:06 -07:00
parent 2ff93d74be
commit 8e5ff51257
6 changed files with 52 additions and 13 deletions

View file

@ -7,6 +7,10 @@ import (
"time"
)
const (
DEBUG_SERVER = true
)
type ClientNameMap map[string]*Client
type ChannelNameMap map[string]*Channel
type UserNameMap map[string]*User
@ -40,7 +44,9 @@ func NewServer(name string) *Server {
func (server *Server) receiveCommands(commands <-chan Command) {
for command := range commands {
log.Printf("%s ← %s %s", server, command.Client(), command)
if DEBUG_SERVER {
log.Printf("%s ← %s %s", server, command.Client(), command)
}
command.Client().atime = time.Now()
command.HandleServer(server)
}