Polymorphic logging

Change-Id: I969726a7498ed23abc5ed6fe5fdfbc16cf8ff3b3