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

gh-2618: Cleanup inconsistent use of logging strings #2651

Merged
merged 12 commits into from
May 26, 2022
Merged

gh-2618: Cleanup inconsistent use of logging strings #2651

merged 12 commits into from
May 26, 2022

Conversation

RobertG111
Copy link
Contributor

@RobertG111 RobertG111 commented May 19, 2022

Hi. This is my first ever contribution, thanks for the opportunity. The other pull request I created was closed due to having my personal email address. I have fixed the minor issues in relation to inconsistent use of logging strings. All logging functions used the correct format and was able to find only 1 extra mistake apart from the mentioned one in the issue. Thanks.

@GCHQDeveloper314 GCHQDeveloper314 changed the title Cleanup inconsistent use of logging strings #2618 (Solved) gh-2618: Cleanup inconsistent use of logging strings May 20, 2022
Copy link
Member

@GCHQDeveloper314 GCHQDeveloper314 left a comment

Choose a reason for hiding this comment

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

Hello, thanks for your contribution. I've renamed the PR title to fit the naming scheme we use, this is partly described on our new ways of working page.

In your commit you've missed out the {} mentioned in the issue. This is required to add the parameter to the formatted log string.

Also, the issue calls for the problem to be fixed across the repo. You've found one other instance, but there are many others. Searching the repo using LOGGER.*\+ as a regex query, I can see 20+ other instances of string concatenation (some of which are partly using parameters).

@RobertG111
Copy link
Contributor Author

Noted. Thanks for the fast reply.

@codecov-commenter
Copy link

codecov-commenter commented May 20, 2022

Codecov Report

Merging #2651 (dee22a4) into develop (c33d0d8) will decrease coverage by 0.45%.
The diff coverage is 44.82%.

@@              Coverage Diff              @@
##             develop    #2651      +/-   ##
=============================================
- Coverage      66.71%   66.25%   -0.46%     
  Complexity      2521     2521              
=============================================
  Files            997      864     -133     
  Lines          32492    27302    -5190     
  Branches        3936     3285     -651     
=============================================
- Hits           21678    18090    -3588     
+ Misses          9117     7746    -1371     
+ Partials        1697     1466     -231     
Impacted Files Coverage Δ
...uk/gov/gchq/gaffer/commonutil/ExecutorService.java 0.00% <0.00%> (ø)
...java/uk/gov/gchq/gaffer/commonutil/StreamUtil.java 20.63% <0.00%> (ø)
.../gchq/gaffer/cache/impl/HazelcastCacheService.java 73.91% <0.00%> (ø)
...q/gaffer/federatedstore/FederatedGraphStorage.java 79.33% <0.00%> (ø)
...etstore/query/JavaPredicateToParquetPredicate.java 50.54% <33.33%> (-0.39%) ⬇️
.../src/main/java/uk/gov/gchq/gaffer/graph/Graph.java 65.01% <50.00%> (ø)
...ration/handler/FederatedAddGraphHandlerParent.java 70.83% <50.00%> (ø)
...gov/gchq/gaffer/graph/hook/FunctionAuthoriser.java 93.54% <100.00%> (ø)
...on/resolver/named/NamedOperationScoreResolver.java 80.00% <100.00%> (ø)
.../uk/gov/gchq/gaffer/rest/config/FactoryConfig.java 78.12% <100.00%> (ø)
... and 139 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a0c863...dee22a4. Read the comment docs.

@t92549 t92549 linked an issue May 20, 2022 that may be closed by this pull request
Copy link
Contributor

@t92549 t92549 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Just a small change of syntax is required to get this working, I have linked an article in the review comment.

Copy link
Contributor

@t92549 t92549 left a comment

Choose a reason for hiding this comment

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

Thanks for all the updates! Still a couple more issues

Copy link
Contributor

@t92549 t92549 left a comment

Choose a reason for hiding this comment

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

Looking good and passing CI now, however, after a quick look I can see 5 more uses that aren't changed: 4 in example and one in store-implementation/parquet-store

Copy link
Contributor

@t92549 t92549 left a comment

Choose a reason for hiding this comment

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

Great changes, just a few more I found that are missed:

@GCHQDeveloper314
Copy link
Member

The latest error is caused by the logging in RoadTrafficDataLoader.java being done from Java's util logger. This is used in a few places across road-traffic. Ideally SLF4J would be used, however that is not within scope of this ticket. Reverting any changes to the util logger (because it doesn't support parameterised logging) is what we'll want to do in this PR. Investigating changing to SLF4J is something we might raise as a new ticket.

@t92549
Copy link
Contributor

t92549 commented May 25, 2022

The latest error is caused by the logging in RoadTrafficDataLoader.java being done from Java's util logger. This is used in a few places across road-traffic. Ideally SLF4J would be used, however that is not within scope of this ticket. Reverting any changes to the util logger (because it doesn't support parameterised logging) is what we'll want to do in this PR. Investigating changing to SLF4J is something we might raise as a new ticket.

That's my bad sorry, I said it needs changing but didn't realise it was using the java.util logger, apologies!

@t92549
Copy link
Contributor

t92549 commented May 25, 2022

I think all cases are now covered, to get the CI passing the road-traffic example cases need to be reverted because they aren't using SLF4J, sorry!

Copy link
Member

@GCHQDeveloper314 GCHQDeveloper314 left a comment

Choose a reason for hiding this comment

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

I can see a few remaining string concatenations across multiple lines, but there's nothing we can do about that as we are not using a new enough version of Java to use avoid this. PR looks to be ready to merge.

@RobertG111
Copy link
Contributor Author

Thanks @t92549 @GCHQDeveloper314 for the help and reviews. It has been great working on this and will continue contributing. Many thanks.

Copy link
Contributor

@t92549 t92549 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Apologies that a couple of times I suggested things that were actually incorrect!

@t92549 t92549 merged commit d354dc6 into gchq:develop May 26, 2022
t92549 pushed a commit that referenced this pull request May 26, 2022
* Found 1 extra inconsistency than the mentioned one

* found and fixed other inconsitencies

* further fixes

* further fixes 2

* fixed 3 out of 4 checkstyle errors - 1 more to fix

* all checkstyle errors fixed

* removed use of String.format

* removed another instance of using String.format

* more changes

* additional change

* reverted changes
t92549 added a commit that referenced this pull request May 27, 2022
…ings (#2651) (#2658)

* gh-2618: Cleanup inconsistent use of logging strings (#2651)

* Found 1 extra inconsistency than the mentioned one

* found and fixed other inconsitencies

* further fixes

* further fixes 2

* fixed 3 out of 4 checkstyle errors - 1 more to fix

* all checkstyle errors fixed

* removed use of String.format

* removed another instance of using String.format

* more changes

* additional change

* reverted changes

* gh-2657: Revert accidental change

* gh-2657: Update copyright with spotless

Co-authored-by: Robert <33911814+RobertG111@users.noreply.github.com>
t92549 added a commit that referenced this pull request May 12, 2023
* Update docs links in README

* Revert "Update docs links in README"

This reverts commit 2d87bf3.

* gh-2559 added hasTrait, its handler and corresponding tests (#2561)

* gh-2559 added hasTrait, its handler and corresponding tests

* gh-2559 amended comment in HasTrait, added additional tests for the handler

* gh-2559 null check & tidy test

Co-authored-by: t92549 <80890692+t92549@users.noreply.github.com>

* Update links to Gaffer docs in all files (#2566)

Co-authored-by: t92549 <80890692+t92549@users.noreply.github.com>

* gh-2604: Deprecates Parquet (#2606)

* gh-2556: Add HBaseStore deprecated tag, javadocs and note to README (#2605)

* gh-2556: Add HBaseStore deprecated tag, javadocs and note to README

* gh-2556: Amend version number

* Upgrade Hazelcast version to 5.1.1 (#2612)

Co-authored-by: t92549 <80890692+t92549@users.noreply.github.com>

* Gh-2602: Replace Log4j with Reload4j (#2609)

* Replace Log4j with Reload4j
Also add enforcer plugin to prevent future problems

* FederatedStoreGetTraitsTest did not delete the cache service before carrying out each test causing it to fail when run as part of the maven tests. In isolation it passed. Found that the FederatedGraphStorageTraitsTest was also not clearing the cache. Added the before and after cache clearance and bumped the JUnit version of FederatedStoreGetTraitsTest from 4 to 5. Tests now pass (#2617)

Co-authored-by: r32575 <63105662+r32575@users.noreply.github.com>

* Gh 2562 GetElementsWithinSet not allowing for the exclusion of properties - Gaffer v1 (#2597)

* Fixed bug gh-2562. View properties are now being filtered. Added tests

* After a review moved the return statements inside the doPostFilter if-check and changed a conditional fail to an assertThat test

* Removed the try-finally blocks as the classes implement CloseableIterable

* Added failure message to test

* Adjusted javadoc formatting

* Removed rogue letter

Co-authored-by: t92549 <80890692+t92549@users.noreply.github.com>

* prepare release gaffer2-1.22.0

* prepare for next development iteration

* gh-2618: Cleanup inconsistent use of logging strings (#2651)

* Found 1 extra inconsistency than the mentioned one

* found and fixed other inconsitencies

* further fixes

* further fixes 2

* fixed 3 out of 4 checkstyle errors - 1 more to fix

* all checkstyle errors fixed

* removed use of String.format

* removed another instance of using String.format

* more changes

* additional change

* reverted changes

* replaced to SLF4J (#2663)

* gh-2669: Added new aggregation function endpoints (#2670)

* gh-2673: Fix links to koryphe core (#2674)

* Gh 2705 operation details spring (#2706)

* gh-2705: Cherry pick new spring endpoint

* gh-2696: Added tests for new all operation details endpoint (#2700)

* gh-2696: Added tests for new all operation details endpoint

* gh-2696: Spotless apply

* gh-2705: Copyright fix

* Gh-2745: Fix crown copyright link

Fixed Crown Copyright Link on Line 44

* Gh-2776: Create issue templates (#2777)

* Create issue templates

* Simplify bug report

* build(deps): bump hazelcast (#2848)

Bumps [hazelcast](https://github.com/hazelcast/hazelcast) from 5.1.1 to 5.1.3.
- [Release notes](https://github.com/hazelcast/hazelcast/releases)
- [Commits](hazelcast/hazelcast@v5.1.1...v5.1.3)

---
updated-dependencies:
- dependency-name: com.hazelcast:hazelcast
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* GH-2845: updt class var parameter to use Map interface (#2846)

Co-authored-by: t92549 <80890692+t92549@users.noreply.github.com>

* Gh-2914: Remove redundant constants class (#2927)

* #2914 Issue: Remove redundant constants class

* Simplify charset

* Fix import

* Remove erroneous use of charset with JSONSerialiser.serialise

* Use StandardCharsets inbuilt function
---------

Co-authored-by: GCHQDeveloper314 <94527357+GCHQDeveloper314@users.noreply.github.com>

* prepare release gaffer2-1.23.0

* prepare for next development iteration

* Fix field names in ToCsv

* Refactor to string enums

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: GCHQDeveloper314 <94527357+GCHQDeveloper314@users.noreply.github.com>
Co-authored-by: p3430233 <61738524+p3430233@users.noreply.github.com>
Co-authored-by: r32575 <63105662+r32575@users.noreply.github.com>
Co-authored-by: Gaffer <github-actions@github.com>
Co-authored-by: Robert <33911814+RobertG111@users.noreply.github.com>
Co-authored-by: Anirban Patra <96457415+AnirbanPatragithub@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kvaithin <68995267+kvaithin@users.noreply.github.com>
Co-authored-by: Brijesh Yadav <brijeshyadavjthj@gmail.com>
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.

Cleanup inconsistent use of logging strings
4 participants