Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.String cannot be converted to org.slf4j.Marker

I'm using import lombok.extern.slf4j.Slf4j; for my class, and here's my log statement:log.info("{} : {} - {}", String1, String2, String3);

But it fails to compile and complaining the above line:java.lang.String cannot be converted to org.slf4j.Marker

Any ideas please?

like image 447
Fisher Coder Avatar asked Jan 26 '17 18:01

Fisher Coder


1 Answers

I guess that you are willing to use info(String format, Object... arguments) and are wondering why the method that is really called is info(Marker marker, String format, Object arg1, Object arg2).

This is related to Most Specific Method selection and Identify Potentially Applicable Methods.

As you have exactly four parameters, out of which three matches perfectly, the info(Marker marker, String format, Object arg1, Object arg2) method must be considered as "potentially matching".

You should read the documentation about variable arity parameters to get more details.

like image 175
Kraal Avatar answered Oct 16 '22 03:10

Kraal