Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update src/main/java/org/utplsql/cli/LoggerConfiguration.java
Co-Authored-By: pesse <[email protected]>
  • Loading branch information
Pazus and pesse authored Feb 11, 2019
commit 00c712adaabd8b3d9f7e943fa7326e5c8eb9fa27
4 changes: 3 additions & 1 deletion src/main/java/org/utplsql/cli/LoggerConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
import org.utplsql.api.TestRunner;

class LoggerConfiguration {

private LoggerConfiguration() {
throw new UnsupportedOperationException();
}
static void configure(boolean silent, boolean debug) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we use two parameters here? Are all 4 combination of their values valid? Maybe we should accept 3-valued enum?

SILENT, DEFAULT, DEBUG

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Reason is to make it easy to just pass the parameters of the RunCommand to the LoggerConfigurator.
Enum would increase clarity of the LoggerConfigurator class taken alone but not its usage. This way it's clear that logging is depenent on two flags.
If we can increase clarity on the fact that silent is superior to debug, I'd appreciate it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should. If non flags are passed then default logging is enabled, if silent - non, if debug - debug. And then we end up with 3 levels, set on application level and non of other classes should think about it. Classes just log using appropriate log level (logger.info, logger.debug).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm not sure if I get you completely right.
You'd like to introduce a 3-leveled ENUM and shift the logic which configuration to take to the RunCommand?
The classes themselves already use appropriate log level, the purpose of the configuration is to either hide or show the log information.

if ( silent )
configureSilent();
Expand Down