oakmound / oak

A pure Go game engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add easy way to use regular expressions with dlog.

lolbinarycat opened this issue · comments

Regular expressions are just so much more versatile for string matching.
I actually already have an implementation in my own fork of oak.
It also allows you to adjust the level that overrides filters (which seems to be hardcoded as WARN in the original implementation, although there doesn't seem to be any comments about it).

To make sure we're on the same page, the logger oak comes with can be replaced as it stands with dlog.SetLogger, and custom loggers can support any type of filter they want.

Is this request asking to add another type of logger other than the default that supports this, or for the default to support regex filters?

Well, either would be fine really, and I'm not sure which one would be better. I implemented the former (which wraps around the default), mostly because it was easier than reworking the default logger.