X-Git-Url: http://www.git.cypherpunks.ru/?p=goircd.git;a=blobdiff_plain;f=events.go;h=283b5f76d5039ba03fa0e1f2b2cbefced7f877cd;hp=44974b8c8914d91294cfd823e9b97713f09d3226;hb=236377e360e37e16986588a62101926d70ad3489;hpb=e9a315574b96c6a235c9d55e607c3b4526eedf2f diff --git a/events.go b/events.go index 44974b8..283b5f7 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-2020 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) + 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)