• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to pass exception as one of the object[] when doing logging?

 
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to understand is it possible to have functionality of both these methods in one place? for example have a formatted message with the parameters and also have the exception being logged along with the message?



Thank you.
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

raminaa niilian wrote:Hi,

I am trying to understand is it possible to have functionality of both these methods in one place? for example have a formatted message with the parameters and also have the exception being logged along with the message?



Thank you.



If those are all the methods and you can't add any, then it's not possible. Otherwise, if you control that class, you can add a signature that takes level, msg, params, thrown.

Of course, in lieu of calling


you can just call String.format() to format your message and then call

reply
    Bookmark Topic Watch Topic
  • New Topic