I am writing Logger class in PHP. Is there a way, how to automatically pass line number and script file from call?
Sample:
Logger::Log("message", __LINE__, __FILE__)
I want to pass __LINE__ and __FILE__ automatically, without need of writing it. I have tried to make
public static function Log($msg, $l = __LINE__, $f = __FILE__) { ... }
but this pass line number and file of Log method. Is this even possible in PHP?