Story points | 3 |
Tags | logging deprecated |
Hard Prerequisites | |
IMPORTANT: Please review these prerequisites, they include important information that will help you with this content. | |
|
Your directory structure should look like this:
├── spec
| ├── support
| | └── jasmine.json
| └── password_is_valid_spec.js
| └── password_strength_spec.js
├── src
| └── password_checker.js
| └── logger.js // new file for setting up your logger
└── package.json
Note: Please export logger
, a setup object from the new logger.js
file(see above diagram). Exports from part-1 of the project should remain. Use the following named export syntax:
module.exports = { nameOfObject }
Your directory structure should look like this:
├── gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── app
├── build.gradle
└── src
├── main
| └── java
| └── PasswordChecker.java <-------- names are important
| └── logging/
| └── Log4j2Configuration.java
└── test
└── java
└── PasswordCheckerTest.java <-------- names are important
In part 1 of this exercise you created two functions. Now you are going to upgrade that program by adding some logging capabilities. You are expected to use the recommended logging library(or framework) for your programming language:
passwordIsValid
returns true, log the following messageUser password is valid
Otherwise:
User password is not valid
The log level of these messages should be debug
.
Make sure that your messages get printed to the standard output / terminal / console.
Take note, we aren’t actually logging the user’s password. In general you want to avoid logging sensitive information.
passwordIsValid
then log the exact error message.error
.errors.log
.errors.log
file..gitignore
so that the errors.log
file is not in your repo.Please take note: All your previous tests should all pass.
debug
vs error
.errors.log
? Only one type should be there.