make logging more generic so that it works with all kinds of ocp
creates more stringent tests for logging
simplifies logging possibilities: when logging_config is not provided,
nothing is logged, when loggign_config is provided, but
log_every_nth_iter==0, then only final results and metrics history is
logged. Otherwise additonally, the result at every nth iteration is
logged, with the last itertion result also appended.