Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
現在、ログステートメントを次のように書いています。
Log.i(TAG, MyClass.class.getSimpleName() + "#methodName" + someThing);
Class's getSimpleName()ハードコーディングされていない に似たメソッド名を参照する方法はありStringますか?
Class's
getSimpleName()
String
使用できますThread.currentThread().getStackTrace()[1].getMethodName();
Thread.currentThread().getStackTrace()[1].getMethodName();
String methodName = Thread.currentThread().getStackTrace()[1].getMethodName(); Log.i(TAG, MyClass.class.getSimpleName() + methodName + someThing);