custom log methods
argument 2 in log ctor allows injection of custom write method