Debugging
When using the library there are 3 modes that the library can be run in. The difference between each mode is the amount they log to the console. These modes from the least amount of logging to the most are:
- production
- development
- debugging
Production Mode
Only errors are logged. The code to set the library to production mode is shown below,
import { env } from '@ottawamhealth/pbl-calculator-engine';
env.setEnvironmentToProduction();
Development Mode
Errors and warning are logged. The warnings include:
- Whenever a call with data is made, if any of the objects are not used in the calculations we log a warning
- Whenever a call with data is made, if data for a predictor has not been provided we log a warning. For example if a model has a BMI predictor but it is not provided and none of it's substitutions are provided we log a warning.
The code to set the library to development model is shown below,
import { env } from '@ottawamhealth/pbl-calculator-engine';
env.setEnvironmentToDevelopment();
Debugging Mode
Errors, warnings and additional information used by us for debugging are logged. You will most probably never need to use this mode.
The code to set the library to debugging model is shown below,
import { env } from '@ottawamhealth/pbl-calculator-engine';
env.setEnvironmentToDebugging();
In addition, there are other methods available on the env object which can be seen here