Fix for logging segfault on real device (uses appropriate context)