Commit 4f37397
authored
feat: Added optional args to
## Summary
Message formatting is performance heavy. The logger takes formatted message as a parameter, which means message formatting is being done for all types of logs even in cases when the log level does not apply. This PR adds arguments array to the `log` function to carry token values. Logger already has the functionality to `sprintf` based on extra args if the log level applies. This will increase performance in cases where log level is restricted to more conservative ones such as `ERROR`.
## Test plan
- All Unit tests pass
- Manually tested thoroughly with optimizely-sdk package. A follow up PR for the main package will be created after this is merged and released.logger.log to format string only when log level applies (#706)1 parent f33af13 commit 4f37397
2 files changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
| 224 | + | |
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
| 41 | + | |
| 42 | + | |
0 commit comments