add a paramater to keep track of log type