Using Array.prototype.concat()in a non-array (even as an array) can cause it to add the object itself to the resulting array instead of its contents. Your code also was not actually used [p]in the call concat(), except by simply using it for indirect access to Array.prototype.concat().
Try the following:
function getlog(p) {
return function() {
var mainArguments = [p].concat(Array.prototype.slice.call(arguments));
console.log.apply(console, mainArguments);
};
}