More logging
Initial work on supporting template functions