You have too many variables in the fancylogAdmin command.
You pass your function calling player and reason. But in your log command, you have calling player, command, target players, and reason.
Command and target player are nil in that instance.
There may be other errors too, but, that's the most glaring, and will get you on right track to seeing/fixing others if exist.