X-Git-Url: http://www.git.cypherpunks.ru/?p=goircd.git;a=blobdiff_plain;f=events.go;h=10bb31ca7c48e628f7dc296c84679032f26697ce;hp=44974b8c8914d91294cfd823e9b97713f09d3226;hb=9f6cca6c56d12478afb026ca4bd4ec3a688d6c9b;hpb=e9a315574b96c6a235c9d55e607c3b4526eedf2f diff --git a/events.go b/events.go index 44974b8..10bb31c 100644 --- a/events.go +++ b/events.go @@ -1,6 +1,6 @@ /* goircd -- minimalistic simple Internet Relay Chat (IRC) server -Copyright (C) 2014-2015 Sergey Matveev +Copyright (C) 2014-2016 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 @@ -34,10 +34,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 +77,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)