Added debug message type to log functions. 'E' for error, 'W' for warning and 'I' for info.