X-Git-Url: http://www.git.cypherpunks.ru/?p=goircd.git;a=blobdiff_plain;f=events.go;h=2243e8a25b8e3e0c20ffa1338b8ee9cba7f21388;hp=bc659a6c9eeb0e8302d6e55abecb492245622707;hb=964a1bf9dbe211e21cc093001caa8962d513d513;hpb=df1aca605d645d0db48f9bacdcb7354bbdc1c5ee diff --git a/events.go b/events.go index bc659a6..2243e8a 100644 --- a/events.go +++ b/events.go @@ -1,11 +1,10 @@ /* goircd -- minimalistic simple Internet Relay Chat (IRC) server -Copyright (C) 2014-2015 Sergey Matveev +Copyright (C) 2014-2018 | wn Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. +the Free Software Foundation, version 3 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -34,10 +33,17 @@ const ( EventTopic = iota EventWho = iota EventMode = iota + EventTerm = iota + EventTick = iota FormatMsg = "[%s] <%s> %s\n" FormatMeta = "[%s] * %s %s\n" ) +var ( + logSink chan LogEvent = make(chan LogEvent) + stateSink chan StateEvent = make(chan StateEvent) +) + // Client events going from each of client // They can be either NEW, DEL or unparsed MSG type ClientEvent struct { @@ -70,7 +76,7 @@ func Logger(logdir string, events <-chan LogEvent) { var fd *os.File var err error for event := range events { - logfile = path.Join(logdir, event.where + ".log") + logfile = path.Join(logdir, event.where+".log") fd, err = os.OpenFile(logfile, mode, perm) if err != nil { log.Println("Can not open logfile", logfile, err)