Add custom logging system. TODO: finish the logging system