我有Jenkins ver。 2.7.4我希望在报告中看到自定义消息 除了堆栈跟踪。我需要做些什么?
答案 0 :(得分:5)
如果你正在编写一个jenkins插件并且你已经子类Notifier
,那么你可以使用BuildListener
的实例登录到构建输出,如下所示:
帮助方法:
angular.module("umbraco").controller("Reply.controller", function ($scope, $http, $routeParams) {
$scope.SendReply = function () {
var contentId = $routeParams.id;
var replyText = $("#Reply").val(); // without value ??? (type of Reply is RichTextEditor)
var email = $("#Email").val(); // It's OK.
var dataObj = {
ReplyText: replyText,
ContentId: contentId,
Email: email,
};
$http.post("backoffice/Reply/ReplyToIncomingCall/ReplyMessage", dataObj).then
(
function (response) {
alert("YES!");
//TODO:
}
);
}
});
示例用法:
private void logger(BuildListener listener, String message){
listener.getLogger().println(message);
}
您可以在source code for the packagecloud plugin for jenkins
中查看此实例请参阅:https://wiki.jenkins-ci.org/display/JENKINS/Packagecloud+Plugin