Skip to content

Feature/simple logging #121

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

Merged
merged 14 commits into from
Feb 14, 2019
Merged

Feature/simple logging #121

merged 14 commits into from
Feb 14, 2019

Conversation

pesse
Copy link
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 viniciusam and Pazus February 7, 2019 21:15

class LoggerConfiguration {

static void configure(boolean silent, boolean debug) {
Copy link
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
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
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
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.

@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