Logger function updated