Move console log into cacheMessage function.
Add const to avoid error change.
Add const to avoid error change.
Add const to avoid error change.
Add remove tailing \n utility function.
Remove unnecessary codes.
Add debug logs.
Add log timer trigger function.