Today we start with a singleton exercise
Let's create a java program that has two classes Cat and Dog
They should have some fields it is up to you
And then create a Logger class which takes log messages and prints them to the screen.
- The Logger should be a singleton, create it like that.
- The logger should have logging levels defined in an enum these levels are error, info, debug.
- The logging level can be set at any time and then the Log messages should only appear if the match the level
Traditional log level use:
- When set to error only error messages are printed
- When set to info info and error messages are printed
- When set to debug debug, info and error messages are printed