As we know javascript is single threaded in nature, So due to this limitation long-running javascript code blocks UI thread(freezes the main window) that handles all the task for drawing, refreshing, animating, user inputs events, etc. So as the page freezes, user is not able to interact with your application any more(very unpleasant...
We use logging in our application to report and persist error and warning messages as well as info messages (e.g. runtime statistics) so that the messages can later be retrieved and analyzed. Initially we were getting an instance of Logger from LoggerFactory and uses it in our class for logging information, errors, exceptions, warnings...