Improved logger

- Added the warning function
- Removed fatal as duplicated of the critical function
- Added a private formatLogger function