Fix nil bug in templates cache module.

1. fix nil bug of tplcache.
2. make InitLogger() function available for public.