mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
Make debugging messages easier to turn off.
This commit is contained in:
parent
2ff93d74be
commit
8e5ff51257
6 changed files with 52 additions and 13 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue