Silverstripe Version: 3.1
Question:
I’m new to SilverStripe and php but have to maintain an existing code base.
My first goal is to understand the existing code.
I’ve tried to add logging using below code but get errors.
Being overwhelmed by the sheer amount of new things to learn I’m looking for a code snippet to learn from or a pointer to a relevant document
Note: the API manual for V3 API doc wasn’t really helpful for me as it contains no working code example
SS_Log::add_writer(new SS_LogFileWriter('data/www/mysite/assets/Uploads/my.log'), SS_Log::ERR);
$msg = "Start";
echo $msg;
log($msg, SS_Log::NOTICE);
gives run time error:
[Warning] log() expects parameter 1 to be double, string given
log(Start,5)