only add class::method when inside a method, or else __METHOD__ is an empty string