[SJS-119]: Improve internal log function and debugging function