Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence console output with a "silent" flag in /q command #620

Closed
co221133 opened this issue Oct 22, 2017 · 14 comments
Closed

Silence console output with a "silent" flag in /q command #620

co221133 opened this issue Oct 22, 2017 · 14 comments
Labels
Feature Request New feature or request.

Comments

@co221133
Copy link

To clarify the title a little better, I'd like to know if there's any way to "mute" the messages that are sent to the console when an event is fired. There's one event that I've set to fire quite consistently, but I don't want the messages clogging up all of my logs. It'll make verifying information from the console a lot more difficult; it'd be lost in all the repeated messages of events being fired.

@RiledUpCrow
Copy link
Contributor

Messages about firing events shouldn't ever be displayed in the console unless they're fired with a command. Is that what you're doing?

@RiledUpCrow RiledUpCrow added the Support Question This can be solved on the discord. label Oct 24, 2017
@co221133
Copy link
Author

Yeah, running 'q e {player} {event}'. I've pretty much set up a unique system that runs BetonQuest events through other plugins when their conditions are met. It just happens so frequently that the console gets overrun with spam of the same message.

@MWFIAE
Copy link
Contributor

MWFIAE commented Oct 25, 2017

Hey there,

I don't know what exactly you are doing, but if the plugin is selfmade (I think it is. ) you should probably use this method https://github.com/Co0sh/BetonQuest/blob/master/src/main/java/pl/betoncraft/betonquest/BetonQuest.java#L879 to run your events.
I think that would solve a few problems/make your code easier.

€: Please note, that this method itself checks for all conditions of the event before firing the event.
€2: here the javadoc for the method, as the link with the line could become invalid in future version
/**
* Fires the event described by eventID
*
* @param eventID
* ID of the event to fire, as defined in events.yml
* @param playerID
* ID of the player who the event is firing for
*/
public static void event(String playerID, EventID eventID) {

@RiledUpCrow
Copy link
Contributor

Or you can simply brute force filtering console messages with something like this:
https://www.spigotmc.org/resources/console-spam-fix.18410/
BetonQuest uses a similar approach to filter /betonquestanswer commands used in tellraw conversation IO.

@co221133
Copy link
Author

co221133 commented Oct 25, 2017

Thanks for the suggestions!

I'm not much of a coder, unfortunately, so I don't really understand how to make that first method work. What I'm doing is kinda like stitching together the functionalities of multiple plugins. If there's conditions that BetonQuest don't support that I need to be met for a certain unique achievement on the server, then I can check the conditions with something else like SkillAPI, then have those plugins start the BetonQuest event.

I actually did try using Console Spam Fix, but for whatever reason, putting in "Event fired" or even "Event" as the blocked message didn't work. There's no errors or anything, but the plugin won't even let me use its reload command, so there's a bug that I simply don't understand with it.

Just so you're aware, I am using custom plugins in some instances, but I didn't program them myself. I wish I was that smart! Like I said, I'm just stitching together multiple plugins' functionalities.

EDIT: Maybe an interesting suggestion... what if there was an argument you could add to certain events, like mute:true. That way, you can ensure that events which would typically be run quite frequently won't actually send a message to the console, regardless of how they were activated. Just an idea I had.

@MWFIAE
Copy link
Contributor

MWFIAE commented Oct 25, 2017

BetonQuest.event( playerId>, <eventId>)
should be all that is needed. With eventId being the name of the event you want to fire and the playerId is the uuid of the player as String.

It was most likely just an example but what skillapi condition do you need that is not in Betonquest?
If there are any Conditions etc. that you are needing from other plugins just tell, so that we can work on an Integration :)

@co221133
Copy link
Author

Well, for one, SkillAPI has a Value/Flag system integrated into its skills. Meaning, in combat, I can assign values to the target of certain abilities, or flag them with a string (like "On_Fire"). SkillAPI uses these to check for some of its mechanics before firing them typically. But, instead of having it be a combat ability, I've made a hidden skill the player is unaware of that checks for certain values or flags on the player every 30 seconds. If the player has that flag or value, then I have SkillAPI run the command "q e {player} {event}" so that the achievement unlocks through BetonQuest events with messages/permission adding. Each value is a custom achievement I've added to make the server more unique... sorry if that doesn't make much sense though. It's kind of a convoluted system, I'll admit.

Note: I did once try making timed events through BetonQuest with folders/delays, but I think that it significantly lagged my server, and even began to crash it. BetonQuest is incredibly versatile, but I don't think it enjoys timed events.

@RiledUpCrow
Copy link
Contributor

Nope, folder and delay is not a good solution to such problems. I'm thinking of expanding static events so they can not only run on certain real-world time, but also on minecraft-world time and every n ticks. Then you could use it that way 😛

Anyway, I think I can add a flag for the command to make it silent. Let's make it a feature.

@RiledUpCrow RiledUpCrow changed the title Any Way to Stop "Event Fired" Messages From Going to Console? Silence console output with "--silent" flag in /q command Oct 25, 2017
@RiledUpCrow RiledUpCrow added Feature and removed Support Question This can be solved on the discord. labels Oct 25, 2017
@RiledUpCrow
Copy link
Contributor

You can start adding --silent at the end of every command you intend to run from within your system. It will start working once I push this feature into dev builds.

@co221133
Copy link
Author

Will it be an automatic update? Sorry, I'm unfamiliar with the differences between dev builds and their counterparts.

@RiledUpCrow
Copy link
Contributor

Nope, you need to either manually download that new dev build or use /q update --dev command. The latter will automatically download the latest one and ask you to restart/reload the server.

@Godivctor
Copy link

this don't work anymore?

@J0B10
Copy link
Member

J0B10 commented Jul 2, 2018

It hasn't been implemented yet. If it is implemented this issue will be closed. That way you always know which of these features are implemented and which still need to be coded.

@Wolf2323 Wolf2323 added Feature Request New feature or request. and removed Feature labels Apr 3, 2020
@Wolf2323 Wolf2323 added this to TODO in Commands rework via automation Oct 3, 2020
@SaltyAimbOtter SaltyAimbOtter changed the title Silence console output with "--silent" flag in /q command Silence console output with a "silent" flag in /q command Nov 24, 2020
@Wolf2323
Copy link
Member

Wolf2323 commented Jan 1, 2021

Merged into #1356

@Wolf2323 Wolf2323 closed this as completed Jan 1, 2021
Commands rework automation moved this from TODO to Done Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request.
Projects
No open projects
Development

No branches or pull requests

6 participants