• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IdeaLoggingEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.openapi.diagnostic.IdeaLoggingEvent的典型用法代码示例。如果您正苦于以下问题:Java IdeaLoggingEvent类的具体用法?Java IdeaLoggingEvent怎么用?Java IdeaLoggingEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IdeaLoggingEvent类属于com.intellij.openapi.diagnostic包,在下文中一共展示了IdeaLoggingEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: log

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
private void log(@NotNull IdeaLoggingEvent[] events, @Nullable String additionalInfo) {
  IdeaLoggingEvent ideaEvent = events[0];
  if (ideaEvent.getThrowable() == null) {
    return;
  }
  LinkedHashMap<String, Object> customData = new LinkedHashMap<>();
  customData.put(TAG_PLATFORM_VERSION, ApplicationInfo.getInstance().getBuild().asString());
  customData.put(TAG_OS, SystemInfo.OS_NAME);
  customData.put(TAG_OS_VERSION, SystemInfo.OS_VERSION);
  customData.put(TAG_OS_ARCH, SystemInfo.OS_ARCH);
  customData.put(TAG_JAVA_VERSION, SystemInfo.JAVA_VERSION);
  customData.put(TAG_JAVA_RUNTIME_VERSION, SystemInfo.JAVA_RUNTIME_VERSION);
  if (additionalInfo != null) {
    customData.put(EXTRA_ADDITIONAL_INFO, additionalInfo);
  }
  if (events.length > 1) {
    customData.put(EXTRA_MORE_EVENTS,
        Stream.of(events).map(Object::toString).collect(Collectors.joining("\n")));
  }
  rollbar.codeVersion(getPluginVersion()).log(ideaEvent.getThrowable(), customData);
}
 
开发者ID:google,项目名称:bamboo-soy,代码行数:22,代码来源:RollbarErrorReportSubmitter.java


示例2: createEvent

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
@NotNull
private EventBuilder createEvent(@NotNull IdeaLoggingEvent[] events, @Nullable String additionalInfo) {
    IdeaLoggingEvent ideaEvent = events[0];
    EventBuilder eventBuilder = new EventBuilder();
    eventBuilder.withMessage(ideaEvent.getMessage());
    eventBuilder.withRelease(getPluginVersion());
    eventBuilder.withTag(TAG_PLATFORM_VERSION, getPlatformVersion());
    eventBuilder.withTag(TAG_OS, SystemInfo.OS_NAME);
    eventBuilder.withTag(TAG_OS_VERSION, SystemInfo.OS_VERSION);
    eventBuilder.withTag(TAG_OS_ARCH, SystemInfo.OS_ARCH);
    eventBuilder.withTag(TAG_JAVA_VERSION, SystemInfo.JAVA_VERSION);
    eventBuilder.withTag(TAG_JAVA_RUNTIME_VERSION, SystemInfo.JAVA_RUNTIME_VERSION);
    if (ideaEvent.getThrowable() != null) {
        eventBuilder.withSentryInterface(new ExceptionInterface(ideaEvent.getThrowable()));
    }
    if (additionalInfo != null) {
        eventBuilder.withExtra(EXTRA_ADDITIONAL_INFO, additionalInfo);
    }
    if (events.length > 1) {
        eventBuilder.withExtra(EXTRA_MORE_EVENTS, getMoreEvents(events));
    }
    eventBuilder.withExtra(EXTRA_OTHER_PLUGINS, getOtherPluginsInfo());
    return eventBuilder;
}
 
开发者ID:protostuff,项目名称:protobuf-jetbrains-plugin,代码行数:25,代码来源:SentryBugReporter.java


示例3: addIdeFatalMessage

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
@Nullable
public LogMessage addIdeFatalMessage(final IdeaLoggingEvent aEvent) {
  Object data = aEvent.getData();
  final LogMessage message = data instanceof LogMessage ? (LogMessage)data : new LogMessage(aEvent);
  if (myIdeFatals.size() < MAX_POOL_SIZE_FOR_FATALS) {
    if (myFatalsGrouper.addToGroup(message)) {
      return message;
    }
  } else if (myIdeFatals.size() == MAX_POOL_SIZE_FOR_FATALS) {
    String msg = DiagnosticBundle.message("error.monitor.too.many.errors");
    LogMessage tooMany = new LogMessage(new LoggingEvent(msg, Category.getRoot(), Priority.ERROR, null, new TooManyErrorsException()));
    myFatalsGrouper.addToGroup(tooMany);
    return tooMany;
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:MessagePool.java


示例4: canHandle

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
public boolean canHandle(IdeaLoggingEvent event) {
  if (ourLoggerBroken) return false;

  try {
    UpdateChecker.checkForUpdate(event);

    boolean notificationEnabled = !DISABLED_VALUE.equals(System.getProperty(FATAL_ERROR_NOTIFICATION_PROPERTY, ENABLED_VALUE));

    ErrorReportSubmitter submitter = IdeErrorsDialog.getSubmitter(event.getThrowable());
    boolean showPluginError = !(submitter instanceof ITNReporter) || ((ITNReporter)submitter).showErrorInRelease(event);

    //noinspection ThrowableResultOfMethodCallIgnored
    return notificationEnabled ||
           showPluginError ||
           ApplicationManagerEx.getApplicationEx().isInternal() ||
           isOOMError(event.getThrowable()) ||
           event.getThrowable() instanceof MappingFailedException;
  }
  catch (LinkageError e) {
    if (e.getMessage().contains("Could not initialize class com.intellij.diagnostic.IdeErrorsDialog")) {
      //noinspection AssignmentToStaticFieldFromInstanceMethod
      ourLoggerBroken = true;
    }
    throw e;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:DefaultIdeaErrorLogger.java


示例5: configureErrorFromEvent

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
private static void configureErrorFromEvent(IdeaLoggingEvent event, ErrorBean error) {
  Throwable throwable = event.getThrowable();
  if (throwable != null) {
    PluginId pluginId = IdeErrorsDialog.findPluginId(throwable);
    if (pluginId != null) {
      IdeaPluginDescriptor ideaPluginDescriptor = PluginManager.getPlugin(pluginId);
      if (ideaPluginDescriptor != null && !ideaPluginDescriptor.isBundled()) {
        error.setPluginName(ideaPluginDescriptor.getName());
        error.setPluginVersion(ideaPluginDescriptor.getVersion());
      }
    }
  }

  Object data = event.getData();

  if (data instanceof AbstractMessage) {
    error.setAttachments(((AbstractMessage) data).getIncludedAttachments());
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:20,代码来源:GoogleFeedbackErrorReporter.java


示例6: canHandle

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
public boolean canHandle(IdeaLoggingEvent event) {
  if (ourLoggerBroken) return false;

  try {
    boolean notificationEnabled = !DISABLED_VALUE.equals(System.getProperty(FATAL_ERROR_NOTIFICATION_PROPERTY, ENABLED_VALUE));

    ErrorReportSubmitter submitter = IdeErrorsDialog.getSubmitter(event.getThrowable());
    boolean showPluginError = !(submitter instanceof ITNReporter) || ((ITNReporter)submitter).showErrorInRelease(event);

    //noinspection ThrowableResultOfMethodCallIgnored
    return notificationEnabled ||
           showPluginError ||
           ApplicationManagerEx.getApplicationEx().isInternal() ||
           isOOMError(event.getThrowable()) ||
           event.getThrowable() instanceof MappingFailedException;
  }
  catch (LinkageError e) {
    if (e.getMessage().contains("Could not initialize class com.intellij.diagnostic.IdeErrorsDialog")) {
      //noinspection AssignmentToStaticFieldFromInstanceMethod
      ourLoggerBroken = true;
    }
    throw e;
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:DefaultIdeaErrorLogger.java


示例7: LogMessage

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
public LogMessage(IdeaLoggingEvent aEvent) {
  super();

  myThrowable = aEvent.getThrowable();

  if (StringUtil.isNotEmpty(aEvent.getMessage())) {
    myHeader = aEvent.getMessage();
  }

  if (myThrowable != null && StringUtil.isNotEmpty(myThrowable.getMessage())) {
    if (!myHeader.equals(NO_MESSAGE)) {
      if (!myHeader.endsWith(": ") && !myHeader.endsWith(":")) {
        myHeader += ": ";
      }
      myHeader += myThrowable.getMessage();
    }
    else {
      myHeader = myThrowable.getMessage();
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:LogMessage.java


示例8: submit

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
@Override
public boolean submit(@NotNull IdeaLoggingEvent[] events, @Nullable String additionalInfo,
    @NotNull Component parentComponent, @NotNull Consumer<SubmittedReportInfo> consumer) {
  log(events, additionalInfo);
  consumer.consume(new SubmittedReportInfo(null, null, NEW_ISSUE));
  Messages.showInfoMessage(parentComponent, DEFAULT_RESPONSE, DEFAULT_RESPONSE_TITLE);
  return true;
}
 
开发者ID:google,项目名称:bamboo-soy,代码行数:9,代码来源:RollbarErrorReportSubmitter.java


示例9: submit

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
@Override
public boolean submit(@NotNull IdeaLoggingEvent[] events, @Nullable String additionalInfo,
                      @NotNull Component parentComponent, @NotNull Consumer<SubmittedReportInfo> consumer) {
    EventBuilder eventBuilder = createEvent(events, additionalInfo);
    sentry.sendEvent(eventBuilder);
    consumer.consume(new SubmittedReportInfo(null, null, NEW_ISSUE));
    Messages.showInfoMessage(parentComponent, DEFAULT_RESPONSE, DEFAULT_RESPONSE_TITLE);
    return true;
}
 
开发者ID:protostuff,项目名称:protobuf-jetbrains-plugin,代码行数:10,代码来源:SentryBugReporter.java


示例10: getMoreEvents

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
@NotNull
private StringBuilder getMoreEvents(@NotNull IdeaLoggingEvent[] events) {
    StringBuilder moreEvents = new StringBuilder();
    for (int i = 1; i < events.length; i++) {
        IdeaLoggingEvent event = events[i];
        moreEvents.append(event.toString());
        moreEvents.append("\n");
    }
    return moreEvents;
}
 
开发者ID:protostuff,项目名称:protobuf-jetbrains-plugin,代码行数:11,代码来源:SentryBugReporter.java


示例11: checkForUpdate

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
public static void checkForUpdate(IdeaLoggingEvent event) {
  if (!ourHasFailedPlugins && UpdateSettings.getInstance().isCheckNeeded()) {
    final Throwable throwable = event.getThrowable();
    final IdeaPluginDescriptor pluginDescriptor = PluginManager.getPlugin(IdeErrorsDialog.findPluginId(throwable));
    if (pluginDescriptor != null && !pluginDescriptor.isBundled()) {
      ourHasFailedPlugins = true;
      updateAndShowResult();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:UpdateChecker.java


示例12: error

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
@Override
public void error(Object message) {
  if (message instanceof IdeaLoggingEvent) {
    myLogger.error(message);
  }
  else {
    super.error(message);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:IdeaLogger.java


示例13: processMappingFailed

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
private static void processMappingFailed(final IdeaLoggingEvent event) throws InterruptedException, InvocationTargetException {
  if (!ourMappingFailedNotificationPosted && SystemInfo.isWindows && SystemInfo.is32Bit) {
    ourMappingFailedNotificationPosted = true;
    @SuppressWarnings("ThrowableResultOfMethodCallIgnored") String exceptionMessage = event.getThrowable().getMessage();
    String text = exceptionMessage +
      "<br>Possible cause: unable to allocate continuous memory chunk of necessary size.<br>" +
      "Reducing JVM maximum heap size (-Xmx) may help.";
    Notifications.Bus.notify(new Notification("Memory", "Memory Mapping Failed", text, NotificationType.WARNING), null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:DefaultIdeaErrorLogger.java


示例14: extractLoggingEvent

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
private static IdeaLoggingEvent extractLoggingEvent(Object message, Throwable throwable) {
  //noinspection ThrowableResultOfMethodCallIgnored
  Throwable rootCause = ExceptionUtil.getRootCause(throwable);
  if (rootCause instanceof LogEventException) {
    return ((LogEventException)rootCause).getLogMessage();
  }

  String strMessage = message == null ? "<null> " : message.toString();
  ExceptionWithAttachments withAttachments = ExceptionUtil.findCause(throwable, ExceptionWithAttachments.class);
  if (withAttachments != null) {
    return LogMessageEx.createEvent(strMessage, ExceptionUtil.getThrowableText(throwable), withAttachments.getAttachments());
  }

  return new IdeaLoggingEvent(strMessage, throwable);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:DialogAppender.java


示例15: LogMessage

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
public LogMessage(IdeaLoggingEvent aEvent) {
  super();

  myThrowable = aEvent.getThrowable();

  String header = null;

  if (!StringUtil.isEmptyOrSpaces(aEvent.getMessage())) {
    header = aEvent.getMessage();
  }

  if (myThrowable != null) {
    String message = myThrowable.getMessage();
    if (StringUtil.isNotEmpty(message) && (header == null || !header.startsWith(message))) {
      if (header != null) {
        if (header.endsWith(":")) header += " ";
        else if (!header.endsWith(": ")) header += ": ";
        header += message;
      }
      else {
        header = message;
      }
    }
  }

  if (header == null) {
    header = "No message";
  }

  myHeader = header;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:LogMessage.java


示例16: submit

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
@Override
public boolean submit(@NotNull IdeaLoggingEvent[] events,
                      String additionalInfo,
                      @NotNull Component parentComponent,
                      @NotNull Consumer<SubmittedReportInfo> consumer) {
  ErrorBean errorBean = new ErrorBean(events[0].getThrowable(), IdeaLogger.ourLastActionId);
  return doSubmit(events[0], parentComponent, consumer, errorBean, additionalInfo);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ITNReporter.java


示例17: LogMessageEx

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
/**
 * @param title            text to show in Event Log tool window entry (it comes before 'more')
 * @param notificationText text to show in the error balloon that is popped up automatically
 */
public LogMessageEx(IdeaLoggingEvent aEvent, String title, String notificationText) {
  super(aEvent);
  myEvent = aEvent;
  myTitle = title;
  myNotificationText = notificationText;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:LogMessageEx.java


示例18: createEvent

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
/**
 * @param userMessage      user-friendly message description (short, single line if possible)
 * @param details          technical details (exception stack trace etc.)
 * @param title            text to show in Event Log tool window entry (it comes before 'more'), use <code>null</code> to reuse <code>userMessage</code>
 * @param notificationText text to show in the error balloon that is popped up automatically. Default is <code>com.intellij.diagnostic.IdeMessagePanel#INTERNAL_ERROR_NOTICE</code>
 * @param attachment       attachment that will be suggested to include to the report
 */
public static IdeaLoggingEvent createEvent(String userMessage,
                                           final String details,
                                           @Nullable final String title,
                                           @Nullable final String notificationText,
                                           @Nullable Attachment attachment) {
  return createEvent(userMessage, details, title, notificationText,
                     attachment != null ? Collections.singletonList(attachment) : Collections.<Attachment>emptyList());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:LogMessageEx.java


示例19: actionPerformed

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  final boolean multipleAttachments = (e.getModifiers() & InputEvent.SHIFT_MASK) != 0;
  Attachment[] attachments;
  if (multipleAttachments) {
    attachments = new Attachment[]{new Attachment("first.txt", "first content"), new Attachment("second.txt", "second content")};
  }
  else {
    attachments = new Attachment[]{new Attachment("attachment.txt", "content")};
  }
  IdeaLoggingEvent test = LogMessageEx.createEvent("test", "test details", attachments);
  throw new LogEventException(test);
  //Logger.getInstance("test (with attachments)").error(test);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:DropAnErrorWithAttachmentsAction.java


示例20: submit

import com.intellij.openapi.diagnostic.IdeaLoggingEvent; //导入依赖的package包/类
@Override
public boolean submit(
    @NotNull IdeaLoggingEvent[] events,
    String additionalInfo,
    @NotNull Component parentComponent,
    @NotNull Consumer<SubmittedReportInfo> consumer) {
  ErrorBean errorBean = new ErrorBean(events[0].getThrowable(), IdeaLogger.ourLastActionId);
  return doSubmit(events[0], parentComponent, consumer, errorBean, additionalInfo);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:10,代码来源:GoogleFeedbackErrorReporter.java



注:本文中的com.intellij.openapi.diagnostic.IdeaLoggingEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RollingUpgradeStartupOption类代码示例发布时间:2022-05-23
下一篇:
Java Cancelable类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap