I wrote an IRC bot in node.JS that logs a channel's activity to a JSON file reddit / irc ---------------------------------------------------------------------- sim642 · 2016-02-20 15:36 The way you construct the JSON [here](https://github.com/egladman/hero dotus/blob/19e164cbe0b3521bb9e841a67639965f1e4d70ce/server.js#L31-L39) is plain ugly. You should instead just properly keep a JS object in the exact same format as you want your JSON output to be and then simply writing it with JSON.stringify. You're doing some crazy string concatenation magic which is nothing but confusing. Logging the content of an IRC channel into a JSON object is weird as well because: 1. You store everything in one file which gets massive and also takes massive amounts of memory to store in RAM when your program runs, 2. Usually IRC logs are in plaintext, not JSON because that makes them easy to append to without having to rewrite the entire file content, making it possible to continue the same long in future runs of the program. ---------------------------------------------------------------------- techieee · 2016-02-20 16:18 Thanks for the feedback! ---------------------------------------------------------------------- aperson · 2016-02-21 00:45 And for the love of everything good, use a standard logging format. ---------------------------------------------------------------------- tilpner · 2016-02-21 02:04 Which would you use if you had to decide on one specifically? ---------------------------------------------------------------------- aperson · 2016-02-21 02:26 Energymech is the most common that I know. ---------------------------------------------------------------------- tilpner · 2016-02-21 02:36 Having implemented a parser/formatter for energymech logs, I have to disagree with that. :) Energymech contains less information than other common formats, like irssi or weechat. E.g. it doesn't have dates, only the time of day, and it doesn't say what channel/query it's about. When converting energymech/ZNC logs to weechat, that means you have to pass in this context. In ilc I solved that with CLI arguments for channel and date, optionally inferring the date from the filename, but that was quite painful. ---------------------------------------------------------------------- aperson · 2016-02-21 03:22 Right, I was just mentioning the most common that I know, not the best. I'm just a fan of not reimplenting the wheel so other parsers can be used that already can handle known formats. ---------------------------------------------------------------------- sim642 · 2016-02-21 06:51 IRC and standard are two things which don't belong together. ---------------------------------------------------------------------- tilpner · 2016-02-21 18:59 That was why I originally asked, because the "standard" loggings formats don't necessarily qualify as "good" or "one of the best" logging formats. The irssi format is arguably better than energymech, but it only informs about the date on certain *checkpoints* (Log closed, Log opened, etc.), which makes the log harder to work with. Lines can't stand alone, compared to e.g. weechat. This doesn't mean it's a bad logging format, it's actually pretty neat for reading as a human, but a hypothetical standard logging format should (IMO, of course) also lend itself to being processed easily.