Unfortunately java does not support __FILE__ and __LINE__ but you can get the same functionality with this code which can be placed in one of your libraries.
public static void showTrace(String msg) { if (msg.length() > 0) System.out.println(msg); System.out.println("Trace: " + "file " + new Throwable().getStackTrace()[1].getFileName() + " class " + new Throwable().getStackTrace()[1].getClassName() + " method " + new Throwable().getStackTrace()[1].getMethodName() + " line " + new Throwable().getStackTrace()[1].getLineNumber()); }