Fixed logging

Fixed inconsistencies in logging produced by merging the two setups.
Pending optimization.
Pending: explain logging and add exception / new code for red / green
values.