Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6851165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:12:52+00:00 2026-05-27T01:12:52+00:00

I came across code written by somebody which caught some exception and tried logging

  • 0

I came across code written by somebody which caught some exception and tried logging that as ERROR without printing stacktrace.
I expected below usage

log.error("message", exception);

However it was

log.error("message");

How to catch such coding errors by static code analyzers or any such tool?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:12:53+00:00Added an answer on May 27, 2026 at 1:12 am

    You can use Eclipse and do a File Search over your Workspace with Regular Expression like this:

    ^.*\.(error|debug|info)\([^,]*\);$
    

    This is the best option as you will see the results in the Search panel and be able to jump to the files/lines directly with double-click.

    Also a simple editor like Notepad++ can do the job with its Find in Files option with Regular expressions enabled. Unfortunately, the Notepad++ is not able to do a regex OR like (this|that) so to find log.debug(...)s and log.info(...)s you would need to replace the error keyword manually. Just select the directory of your project and use a pattern like this:

    ^.*\.error\([^,]*\);$
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While I was working i came across a code which was written by somebody
I came across some PHP code that was written by a co-worker (it was
I came across some code written in C that looks like this: if (file
While debugging javascript written by someone else, I came across some code that I've
A while ago, I came across some code that marked a data member of
An interesting issue came up recently. We came across some code that is using
I came across some code that boils down to the following: enum BAR {
I came across some code written in VS7.1 and now I'm trying to get
I just came across a line of code that was written by a co-worker
I came across some code recently that replaces the use of switches by hard-coding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.