• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • 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.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • 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

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!