Logger as a function