Added log calls for >= Moodle 2.7 and < Moodle 2.7