FoxxMD / context-mod

an event-based, reddit moderation bot built on top of snoowrap and written in typescript
https://contextmod.dev
MIT License
49 stars 11 forks source link

Shorten web log output #40

Open OmgImAlexis opened 2 years ago

OmgImAlexis commented 2 years ago

Instead of showing the full link at the end of the log maybe [COM ID] could link to it?

FoxxMD commented 2 years ago

I like the idea but it would require some low-level refactoring. I use winstonjs's label feature to generate those prefixes for logs. Might be easy to do by adding extra meta information to the log object but will need to either a) associate it with the label by id-mapping of some sort or b) make labels objects instead of strings

Then in console/stream transports we would be able to control the transform of the log object to the final string -- could add an additional transport specifically for web that transforms into html. I'm already doing this in a roundabout way for log level colors but its separate from winstonjs atm.