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

Skip to content

Feature/simple logging#121

Merged
Pazus merged 14 commits intodevelopfrom
feature/simple_logging
Feb 14, 2019
Merged

Feature/simple logging#121
Pazus merged 14 commits intodevelopfrom
feature/simple_logging

Conversation

@pesse
Copy link
Copy Markdown
Member

@pesse pesse commented Feb 7, 2019

Adds some simple logging to cli. Does basically this:

######################### utPLCSL cli #########################
#                                                             #
#   utPLSL-cli 3.1.3-SNAPSHOT.local                           #
#   utPLSQL-java-api 3.1.3-SNAPSHOT.123                       #
#   Java-Version: 1.8.0_171                                   #
#   ORACLE_HOME: C:\app\client\sani\product\12.2.0\client_1   #
#                                                             #
#   Thanks for testing!                                       #
#                                                             #
###############################################################

Successfully connected to database. UtPLSQL core: v3.1.2.2130
Oracle-Version: 12.2.0.1.0
Running tests now.
--------------------------------------

Basic logging can be turned off via -q or --quiet
Additional, extensive, non-pretty logging can be turned on via -d or --debug

Fixes #89
Fixes #76

@pesse pesse requested review from Pazus and viniciusam February 7, 2019 21:15
Comment thread pom.xml
Comment thread src/main/java/org/utplsql/cli/LoggerConfiguration.java

class LoggerConfiguration {

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.

Comment thread src/main/java/org/utplsql/cli/LoggerConfiguration.java Outdated
Comment thread src/main/java/org/utplsql/cli/RunCommand.java
Comment thread src/test/java/org/utplsql/cli/TestRunCommandChecker.java
Comment thread pom.xml
@Pazus Pazus merged commit 5c593b1 into develop Feb 14, 2019
@jgebal jgebal deleted the feature/simple_logging branch February 7, 2025 09:08
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.

2 participants