58 |
|
_logger.write(toString(), Logger.ERROR, "Error starting IRCBot: "+e); |
59 |
|
} |
60 |
|
|
61 |
< |
_logger.write(toString(), Logger.SYSINT, "IRC Alerter started"); |
61 |
> |
_logger.write(toString(), Logger.SYSINIT, "IRC Alerter started"); |
62 |
|
} |
63 |
|
|
64 |
|
//---PUBLIC METHODS--- |
66 |
|
public void sendAlert(Alert alert) { |
67 |
|
// only send if it's equal (or above) our level |
68 |
|
if(alert.getLevel() >= _level) { |
69 |
+ |
String alertType = Alert.alerts[alert.getLevel()]+"["+String.valueOf(alert.getLevel())+"]"; |
70 |
|
// sort out the message |
71 |
|
String message = _message; |
72 |
< |
message = StringUtils.replaceText(message, "%level%", String.valueOf(alert.getLevel())); |
72 |
> |
message = StringUtils.replaceText(message, "%level%", alertType); |
73 |
|
message = StringUtils.replaceText(message, "%source%", alert.getSource()); |
74 |
|
message = StringUtils.replaceText(message, "%value%", alert.getValue()); |
75 |
|
message = StringUtils.replaceText(message, "%thresholdValue%", alert.getThresholdValue()); |
229 |
|
* @throws IOException if the disconnection fails |
230 |
|
*/ |
231 |
|
public void disconnect() throws IOException { |
232 |
< |
// send proper QUIET |
232 |
> |
// send proper QUIT |
233 |
|
_socketOut.println("QUIT : iscreamBot component shutting down..."); |
234 |
|
// close the socket |
235 |
|
_socketOut.close(); |