X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=events.go;h=30444dad06d0d18aeacc07bd7551fcb390c8756e;hb=b35f6e7b3c510bea24c0927073720a459055816e;hp=0921069d2cf21748e6bcd34fae076dff206cc44e;hpb=41f96494948d1f9f1e0c3066099e0bd9ad0ee8dd;p=goircd.git diff --git a/events.go b/events.go index 0921069..30444da 100644 --- a/events.go +++ b/events.go @@ -27,26 +27,26 @@ import ( ) const ( - EVENT_NEW = iota - EVENT_DEL = iota - EVENT_MSG = iota - EVENT_TOPIC = iota - EVENT_WHO = iota - EVENT_MODE = iota - FORMAT_MSG = "[%s] <%s> %s\n" - FORMAT_META = "[%s] * %s %s\n" + EventNew = iota + EventDel = iota + EventMsg = iota + EventTopic = iota + EventWho = iota + EventMode = iota + FormatMsg = "[%s] <%s> %s\n" + FormatMeta = "[%s] * %s %s\n" ) // Client events going from each of client // They can be either NEW, DEL or unparsed MSG type ClientEvent struct { - client *Client - event_type int - text string + client *Client + eventType int + text string } func (m ClientEvent) String() string { - return string(m.event_type) + ": " + m.client.String() + ": " + m.text + return string(m.eventType) + ": " + m.client.String() + ": " + m.text } // Logging in-room events @@ -73,9 +73,9 @@ func Logger(logdir string, events <-chan LogEvent) { continue } if event.meta { - format = FORMAT_META + format = FormatMeta } else { - format = FORMAT_MSG + format = FormatMsg } _, err = fd.WriteString(fmt.Sprintf(format, time.Now(), event.who, event.what)) fd.Close()