lukevers / kittens

A scriptable IRC bot hub written in Go with Lua plugins
MIT License
83 stars 10 forks source link

Logging #33

Open lukevers opened 10 years ago

lukevers commented 10 years ago

As of right now the bot creates directories like the following:

./logs/
./logs/{server}/
./logs/{server}/{channel}/

But that is all that it currently does.

lukevers commented 10 years ago

To continue with the organization I'm currently deciding between this:

logs
└── {server}
    └── {channel}
        └── {year}
            └── {month}
                └── {day}.log

and this:

logs
└── {server}
    └── {channel}
        └── {date}.log

although I'm leaning toward the first option. I like to keep my files in order! My idea is that each line will be like the following:

[hh::mm::ss] <username>: text

Something else to think about is an option for where the logs should go. It's unrealistic to think everyone is going to want to clone a git repository and build it. I think that could probably be something to add on later though.

ghost commented 9 years ago

As for where.. I'd say detect the GOOS and put it in a canonical location. If *nix, /var/log/kittens. If Windows... working directory where it was run from? "%userprofile%/Docuemnts/kittens/"? Maybe make it a configuration flag to let the user set their log location or whether or not to have logs at all?

lukevers commented 9 years ago

Yeah totally; when I made this issue /var/log must have slipped my mind. No clue about where windows systems keep their logs, but on *nix systems that would work perfectly.

ghost commented 9 years ago

I think that putting it as a command line flag would be the a good option. Then just check to make sure the directory exists and is writable. Let the user specify if/where to store the logs.