make debug logging a bit more efficient; remove deprecated safe=True args