screepers / screeps-multimeter

The most useful tool on your screeps workbench.
MIT License
89 stars 28 forks source link

Add /pause and /unpause commands #29

Closed SystemParadox closed 4 years ago

SystemParadox commented 4 years ago

Add commands to temporarily pause the console output. This is useful when you've got lots of debug output and you want to review it, or if you want to run a command and not have the output swamped by other logging (pausing only pauses the log output, not the command result output).

CGamesPlay commented 4 years ago

I think "pause" is a misleading name for this. "Pause", to me, implies that when I "unpause" I won't miss any events. I would suggest using "mute" as the name for the plugin instead, since that is exactly what the plugin is doing.

[append] Aside from this, this new plugin looks great to me.

SystemParadox commented 4 years ago

I think I like "mute" better actually.

In using this I've also realised it would be useful to be able to mute individual shards, although arguably you actually want to be able select one specific shard to view and mute the others, so perhaps this should be a different command, like "/filter"?

CGamesPlay commented 4 years ago

I think a /mute command to just pause and review existing logs is useful on its own, although I definitely agree that some mechanism to select specific log messages would be good. I imagine a /filter that just takes a regex would do it, right? /filter shard0 since multimeter prefixes messages with that, /filter W80S20 since my custom logging framework adds the room name to log lines...

SystemParadox commented 4 years ago

@CGamesPlay, there is one thing strongly in favour of calling it pause - that's what it's called on the screeps web console. What do you think?

CGamesPlay commented 4 years ago

I agree with you in that case. Consistency is pretty valuable.

SystemParadox commented 4 years ago

I've made some improvements to this and added a filter command as well. These two commands have to cooperate somewhat with regard to displaying the status (if you're paused, you don't care about the filter as you're effectively filtering everything), so I've added a mechanism for plugins to add a status message.