logbot icon indicating copy to clipboard operation
logbot copied to clipboard

Suggestion: creating main index file/checking logs on program startup

Open unsolaci opened this issue 15 years ago • 3 comments

Not sure if this qualifies here, even if it does, it's a minor issue. More of a suggestion I think.

If a channel directory(logs/#channel/) does not exist, the bot creates the directory and appends a link with the name of the channel to the main index.html file("Logged Channels"). Now, if you remove only the channel directory by hand, the bot will create it, and append the link to the main index.html as usual, even though one already exists there.

Might be a good idea to check the logs on startup, maybe recreate the main index.html file based on existing logs/ subdirectories.

unsolaci avatar Mar 02 '10 13:03 unsolaci

Sorry for the slow reply. With a commit I pushed the other day, it should now create the files if they don't exist without issue. Let me know if it works for you better now.

excid3 avatar Mar 08 '10 01:03 excid3

First of all: Sorry for the super-late reply. Secondly: I've just downloaded the latest revision and I'm afraid it still does that. What I meant was that if you run the bot, let it log a little, then kill it, then rm the channel dir(logs/#channel/), but leave the main logs dir(logs/), and then run it again, what it does is create the channel dir(just the way it should), but it will also append the main index file(logs/index.html) with the channel name(the thing is, the main index file already has the link in it.). So it never checks what channel dirs are present. My suggestion was to maybe generate the main index file based on what directories exist in the logs/ directory.

Anyways, this is not so much of an issue, and can be easily corrected by hand. What I noticed now, there is a similar, but worse issue as described here: http://github.com/excid3/logbot/issues#issue/6

unsolaci avatar Jun 07 '10 22:06 unsolaci

Yeah sorry about that. I've been pretty busy with life and working on other projects that I haven't had time to fix up this bot. I'll see what I can do though. It could use a good refactoring anyways.

excid3 avatar Jun 10 '10 19:06 excid3