Example of a Generated Logger Class
Internationalization Guide B-3
stacktrace="true"
>
<messagebody>This message is followed by a trace</messagebody>
<messagedetail></messagedetail>
<cause></cause>
<action></action>
</logmessage>
<logmessage
messageid="600003"
method="logNoTrace(Throwable t)"
severity="warning"
stacktrace="false"
>
<messagebody>This message is not followed by a trace, but we
can insert its text : {0}</messagebody>
<messagedetail></messagedetail>
<cause></cause>
<action></action>
</logmessage>
<logmessage
messageid="600004"
method="getId()"
severity="info"
>
<messagebody>This message's id will be in the next
message</messagebody>
<messagedetail>A message can contain additional detailed
information.</messagedetail>
<cause>This message is displayed on purpose</cause>
<action>Nothing to do, the example is working</action>
</logmessage>
<logmessage
messageid="600005"
method="showId(String id)"
severity="info"
>
<messagebody>The previous message logged had message id
{0}</messagebody>
<messagedetail></messagedetail>
<cause></cause>
<action></action>
</logmessage>
</message_catalog>
Listing B-2 shows the corresponding java source generated by i18ngen: