logger function added, for more easily write log and debug info