improve logging and try to follow the example of Wordpress on the documentation