How can I log my own message in the log window

In both TransactionManager and ApplicationProgram class, there are a TwoPhaseLogger object called logger. The logger is obtained in the constructor. You can use the following command to show the message in the logger

    logger.log(new ListItem(Color.blue, Color.yellow,"Two Phase Commit Protocol Starts.."));

The ListItem is the object to maintain the background , foreground color and the value of the log message.

In the command above, it means -log the message "Two Phase Commit Protocol Starts" using the blue as background and yellow as the foreground.

You can check the TwoPhaseLogger and ListItem API for detail.


Back to Help Contents