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

Add option to completely disable to BOY console; prints to log instead #7

Merged
merged 2 commits into from
Feb 15, 2021

Conversation

Tom-Willemsen
Copy link

Copy link

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works to stop the logging to the console but there is now no record of the error at all. When run from eclipse you can see the error in the IDE console but it's not present in the isis.log file or in the Help->Console Log. I think it needs to be in at least one of these so that we can diagnose issues on instruments.

I think the way it's implemented could be a bit cleaner. At the least we could use the existing case statements as I've mentioned in the comments. Ideally I think we should implement a new ConsoleServiceSSHelper with the new behaviour and change which one we use. But having looked at the code the loading in is done using reflection so I don't think that that will be easy?

@Tom-Willemsen
Copy link
Author

The logging is now passed from java.util.logger (which css uses) to log4j in the gui PR (ISISComputingGroup/ibex_gui@3a21d26)

I did look at implementing an alternative to ConsoleServiceSSHelper but it was looking very messy and I felt was getting beyond the scope of this ticket. Happy to discuss further if you want.

I've fixed the code comments.

switch (PreferencesHelper.getConsolePopupLevel()) {
case ALL:
popConsoleView();
break;
case NO_CONSOLE:
OPIBuilderPlugin.getLogger().log(Level.WARNING, message);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
OPIBuilderPlugin.getLogger().log(Level.WARNING, message);
OPIBuilderPlugin.getLogger().log(Level.ERROR, message);

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this would be nice, but unfortunately it doesn't compile as ERROR isn't a valid errorlevel. WARNING felt like the most appropriate from this list: https://docs.oracle.com/javase/7/docs/api/java/util/logging/Level.html. We could use SEVERE but that doesn't exist in log4j world so would get logged as INFO anyway - I preferred to stick with levels that exist in both...

@John-Holt-Tessella John-Holt-Tessella merged commit 46a36d1 into master Feb 15, 2021
@John-Holt-Tessella John-Holt-Tessella deleted the Ticket5302_boy_console_disable branch February 15, 2021 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants