|
36 | 36 | import org.pircbotx.UserLevel; |
37 | 37 | import org.pircbotx.output.OutputChannel; |
38 | 38 | import org.pircbotx.output.OutputIRC; |
| 39 | +import org.slf4j.Logger; |
| 40 | +import org.slf4j.LoggerFactory; |
39 | 41 |
|
40 | 42 | import javax.net.ssl.HttpsURLConnection; |
41 | 43 | import javax.net.ssl.SSLContext; |
|
67 | 69 | * @author Kohsuke Kawaguchi |
68 | 70 | */ |
69 | 71 | public class IrcListener extends ListenerAdapter { |
| 72 | + |
| 73 | + private static final Logger LOGGER = LoggerFactory.getLogger(IrcListener.class); |
| 74 | + |
70 | 75 | /** |
71 | 76 | * Records commands that we didn't understand. |
72 | 77 | */ |
@@ -108,7 +113,8 @@ public void onMessage(MessageEvent e) { |
108 | 113 | } |
109 | 114 | } catch (RuntimeException ex) { // Catch unhandled runtime issues |
110 | 115 | ex.printStackTrace(); |
111 | | - channel.send().message("An error ocurred in the Bot. Please submit a bug to Jenkins INFRA project."); |
| 116 | + channel.send().message("An error ocurred. Please submit a ticket to the Jenkins infra helpdesk with the following exception:"); |
| 117 | + channel.send().message("https://github.com/jenkins-infra/helpdesk/issues/new?assignees=&labels=triage,irc&template=1-report-issue.yml"); |
112 | 118 | channel.send().message(ex.getMessage()); |
113 | 119 | throw ex; // Propagate the error to the caller in order to let it log and handle the issue |
114 | 120 | } |
@@ -878,7 +884,7 @@ boolean forkGitHub(Channel channel, User sender, String owner, String repo, Stri |
878 | 884 | } catch (IOException e) { |
879 | 885 | // we started seeing 500 errors, presumably due to time out. |
880 | 886 | // give it a bit of time, and see if the repository is there |
881 | | - System.out.println("GitHub reported that it failed to fork "+owner+"/"+repo+". But we aren't trusting"); |
| 887 | + LOGGER.warn("GitHub reported that it failed to fork {}/{}. But we aren't trusting", owner, repo); |
882 | 888 | r = null; |
883 | 889 | for (int i=0; r==null && i<5; i++) { |
884 | 890 | Thread.sleep(1000); |
@@ -1011,8 +1017,8 @@ public static void main(String[] args) throws Exception { |
1011 | 1017 | .addCapHandler(new SASLCapHandler(IrcBotConfig.NAME, args[0])); |
1012 | 1018 | } |
1013 | 1019 |
|
1014 | | - System.out.println("Connecting to "+IrcBotConfig.SERVER+" as "+IrcBotConfig.NAME); |
1015 | | - System.out.println("GitHub organization = "+IrcBotConfig.GITHUB_ORGANIZATION); |
| 1020 | + LOGGER.info("Connecting to {} as {}.", IrcBotConfig.SERVER, IrcBotConfig.NAME); |
| 1021 | + LOGGER.info("GitHub organization: {}", IrcBotConfig.GITHUB_ORGANIZATION); |
1016 | 1022 |
|
1017 | 1023 | PircBotX bot = new PircBotX(builder.buildConfiguration()); |
1018 | 1024 | bot.startBot(); |
|
0 commit comments