Logs this BranchEvent to Branch for tracking and analytics

@param context Current context
@return {@code true} if the event is logged to Branch
183093
public boolean logEvent(Context context) {
        boolean isReqQueued = false;
        String reqPath = isStandardEvent ? Defines.RequestPath.TrackStandardEvent.getPath() : Defines.RequestPath.TrackCustomEvent.getPath();
        if (Branch.getInstance() != null) {
            Branch.getInstance().handleNewRequest(new ServerRequestLogEvent(context, reqPath));
            isReqQueued = true;
        }
        return isReqQueued;
    }
1222334
public static boolean isExistAccessContextOnThread() {
        final Stack<AccessContext> stack = threadLocal.get();
        return stack != null ? !stack.isEmpty() : false;
    }
1334684
public boolean audit(AnnotationAuditEvent annotationEvent) {
        List<AuditAnnotationFilter> filters = Context.getConfigContext().getAnnotationFilters();
        if (!filters.isEmpty()) {
            for (AuditAnnotationFilter filter : filters) {
                if (!filter.accepts(annotationEvent)) {
                    return false;
                }
            }
        }
        Context.getAuditStream().write(annotationEvent);
        return true;
    }
539204
@Override
    public void audit(final LoggingEvent e) {
        try {
            logger.info(MarkerFactory.getMarker(AUDIT), serialize(e));
        } catch (Exception ex) {
            throw new RuntimeException("unable to serialize event", ex);
        }
    }
1224448
public boolean isAllowedCachedLeft(final ContextEntry[] context,
                                       final InternalFactHandle handle) {
        return (indexed[0] || constraints[0].isAllowedCachedLeft(context[0], handle)) &&
               (indexed[1] || constraints[1].isAllowedCachedLeft(context[1], handle)) &&
               (indexed[2] || constraints[2].isAllowedCachedLeft( context[2], handle ));
    }
705007
@Override
    public void doExecute(final TestContext context) {
        final Message message = createMessage(context, messageType);
        finished = new CompletableFuture<>();

        // extract variables from before sending message so we can save dynamic message ids
        for (VariableExtractor variableExtractor : variableExtractors) {
            variableExtractor.extractVariables(message, context);
        }

        final Endpoint messageEndpoint = getOrCreateEndpoint(context);

        if (StringUtils.hasText(message.getName())) {
            context.getMessageStore().storeMessage(message.getName(), message);
        } else {
            context.getMessageStore().storeMessage(context.getMessageStore().constructMessageName(this, messageEndpoint), message);
        }

        if (forkMode) {
            log.debug("Forking message sending action ...");

            SimpleAsyncTaskExecutor taskExecutor = new SimpleAsyncTaskExecutor();
            taskExecutor.execute(() -> {
                try {
                    messageEndpoint.createProducer().send(message, context);
                } catch (Exception e) {
                    if (e instanceof CitrusRuntimeException) {
                        context.addException((CitrusRuntimeException) e);
                    } else {
                        context.addException(new CitrusRuntimeException(e));
                    }
                } finally {
                    finished.complete(null);
                }
            });
        } else {
            try {
                messageEndpoint.createProducer().send(message, context);
            } finally {
                finished.complete(null);
            }
        }
    }
428750
@AroundInvoke
	public Object monitor(InvocationContext context) throws Exception {
		if (isMonitored(context)) {
			String simonName = getSimonName(context);
			try (Split ignored = SimonManager.getStopwatch(simonName).start()) {
				return context.proceed();
			}
		} else {
			return context.proceed();
		}
	}
1100494
@Activate
    protected void activate(ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
            Tr.event(tc, "activate", context);
    }
154042
public synchronized boolean enableContext(final String contextPath, final String jvmRoute, final List<String> aliases) {
        final Node node = nodes.get(jvmRoute);
        if (node != null) {
            Context context = node.getContext(contextPath, aliases);
            if (context == null) {
                context = node.registerContext(contextPath, aliases);
                UndertowLogger.ROOT_LOGGER.registeringContext(contextPath, jvmRoute);
                UndertowLogger.ROOT_LOGGER.registeringContext(contextPath, jvmRoute, aliases);
                for (final String alias : aliases) {
                    VirtualHost virtualHost = hosts.get(alias);
                    if (virtualHost == null) {
                        virtualHost = new VirtualHost();
                        hosts.put(alias, virtualHost);
                    }
                    virtualHost.registerContext(contextPath, jvmRoute, context);
                }
            }
            context.enable();
            return true;
        }
        return false;
    }
521138
public static AuditableExecutionResult of(final AuditableContext context) {
        val builder = AuditableExecutionResult.builder();
        context.getTicketGrantingTicket().ifPresent(builder::ticketGrantingTicket);
        context.getAuthentication().ifPresent(builder::authentication);
        context.getAuthenticationResult().ifPresent(builder::authenticationResult);
        context.getRegisteredService().ifPresent(builder::registeredService);
        context.getService().ifPresent(builder::service);
        context.getServiceTicket().ifPresent(builder::serviceTicket);
        builder.properties(context.getProperties());
        return builder.build();
    }
465505
public boolean isManagerOfProject(CmsRequestContext context) {

        try {
            return getAllManageableProjects(
                context,
                readOrganizationalUnit(context, context.getCurrentProject().getOuFqn()),
                false).contains(context.getCurrentProject());
        } catch (CmsException e) {
            // should never happen
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getLocalizedMessage(), e);
            }
            return false;
        }
    }
936092
function getLoggingContext(app, context) {
    context = context || {};
    context.environment = process.env.NODE_ENV || 'local';
    context.name = app;
    context.hostname = os.hostname();
    context.pid = process.pid;

    return context;
}
653156
public static boolean isActivity(Object context) {
		
		return (Activity.class.isAssignableFrom(context.getClass())
				|| FragmentActivity.class.isAssignableFrom(context.getClass()));
	}
1037786
public boolean contextInfoRequired(String eventType, long requestNumber) {

		boolean needContextInfo = false;

		List<ProbeExtension> probeExtnList = RequestProbeService
				.getProbeExtensions();

		for (int i = 0; i < probeExtnList.size(); i++) {
			ProbeExtension probeExtension = probeExtnList.get(i);
			if (requestNumber % probeExtension.getRequestSampleRate() == 0) {
				if (probeExtension.getContextInfoRequirement() == ContextInfoRequirement.ALL_EVENTS) {
					needContextInfo = true;
					break;

				} else if (probeExtension.getContextInfoRequirement() == ContextInfoRequirement.EVENTS_MATCHING_SPECIFIED_EVENT_TYPES
						&& (probeExtension.invokeForEventTypes() == null || probeExtension
								.invokeForEventTypes().contains(eventType))) {
					needContextInfo = true;
					break;
				}
			}
		}
		return needContextInfo;
	}
239284
public boolean parse(Context context) throws NestingException {
        boolean flag = true;
        Source source = context.getSource();
        int offset = source.getOffset();

        // Log start parsing
        if (log.isTraceEnabled()) {
            log.trace("[{}] Begin {}", offset, this);
        }

        int i;
        for (i = 0; i < patternSize && flag; i++) {
            ProcPatternElement current = elements.get(i);
            ProcPatternElement next;
            if (i < patternSize - 1) {
                next = elements.get(i + 1);
            } else {
                next = context.getTerminator();
            }
            flag = current.parse(context, next);
        }

        if (!flag) {
            if (log.isTraceEnabled()) {
                log.trace("[{}] Rollback {} on {} element", source.getOffset(), this, i);
            }

            source.setOffset(offset);
        } else {
            if (log.isTraceEnabled()) {
                log.trace("[{}] Complete {}", source.getOffset(), this);
            }
        }

        return flag;
    }
104932
void start(final Context context) {
		checkConversationQueue();

		ApptentiveLog.i(TROUBLESHOOT, "Overriding log level: " + VERBOSE);
		oldLogLevel = ApptentiveLog.getLogLevel();
		ApptentiveLog.overrideLogLevel(VERBOSE);

		// show debug notification
		showDebugNotification(context);
	}
482510
private LoggingEvent buildEvent() {
    if (currentMap.size() == 0) {
      if (additionalLines.size() > 0) {
        for (Iterator iter = additionalLines.iterator();iter.hasNext();) {
          getLogger().info("found non-matching line: " + iter.next());
        }
      }
      additionalLines.clear();
      return null;
    }
    //the current map contains fields - build an event
    int exceptionLine = getExceptionLine();
    String[] exception = buildException(exceptionLine);

    //messages are listed before exceptions in additionallines
    if (additionalLines.size() > 0 && exception.length > 0) {
      currentMap.put(MESSAGE, buildMessage((String) currentMap.get(MESSAGE),
          exceptionLine));
    }
    LoggingEvent event = convertToEvent(currentMap, exception);
    currentMap.clear();
    additionalLines.clear();
    return event;
  }