A: Using three types of log:
   1) LogInfo:  Normal log used to notify the developer.
   2) LogDebug: Detailed log, which is used to debug a bug.
   3) LogError: Critical log, which is used to inform user the Error msg.

B: Closing the Database as soon as it being initialized.