* Added safety checks for availability of context and preferences before calling through to logging methods (avoid null pointer exceptions in case of wrong timing of activity clean up and tracking)