Codota Logo
LogEntry.getSeverity
Code IndexAdd Codota to your IDE (free)

How to use
getSeverity
method
in
com.google.cloud.logging.LogEntry

Best Java code snippets using com.google.cloud.logging.LogEntry.getSeverity (Showing top 9 results out of 315)

  • Common ways to obtain LogEntry
private void myMethod () {
LogEntry l =
  • Codota IconLogEntry.Builder logEntryBuilder;logEntryBuilder.build()
  • Smart code suggestions by Codota
}
origin: googleapis/google-cloud-java

public void write(Iterable<LogEntry> logEntries, WriteOption... options) {
 if (inWriteCall.get() != null) {
  return;
 }
 inWriteCall.set(true);
 try {
  writeLogEntries(logEntries, options);
  if (flushSeverity != null) {
   for (LogEntry logEntry : logEntries) {
    // flush pending writes if log severity at or above flush severity
    if (logEntry.getSeverity().compareTo(flushSeverity) >= 0) {
     flush();
     break;
    }
   }
  }
 } finally {
  inWriteCall.remove();
 }
}
origin: googleapis/google-cloud-java

assertThat(entry.getResource().getLabels()).containsEntry("project_id", options.getProjectId());
assertThat(entry.getHttpRequest()).isNull();
assertThat(entry.getSeverity()).isEqualTo(Severity.INFO);
assertThat(entry.getOperation()).isNull();
assertThat(entry.getInsertId()).isNotNull();
origin: googleapis/google-cloud-java

assertEquals(resource, entry.getResource());
assertNull(entry.getHttpRequest());
assertEquals(Severity.WARNING, entry.getSeverity());
assertNull(entry.getOperation());
assertNotNull(entry.getInsertId());
origin: googleapis/google-cloud-java

assertEquals("global", entry.getResource().getType());
assertEquals(HttpRequest.newBuilder().setStatus(500).build(), entry.getHttpRequest());
assertEquals(Severity.DEFAULT, entry.getSeverity());
assertNull(entry.getOperation());
assertNotNull(entry.getInsertId());
assertEquals("cloudsql_database", entry.getResource().getType());
assertEquals(Operation.of("operationId", "operationProducer"), entry.getOperation());
assertEquals(Severity.DEFAULT, entry.getSeverity());
assertNull(entry.getHttpRequest());
assertNotNull(entry.getInsertId());
origin: googleapis/google-cloud-java

LogEntry logEntry = LogEntry.of(STRING_PAYLOAD);
assertEquals(STRING_PAYLOAD, logEntry.getPayload());
assertEquals(Severity.DEFAULT, logEntry.getSeverity());
assertEquals(ImmutableMap.of(), logEntry.getLabels());
assertNull(logEntry.getLogName());
assertEquals(LOG_NAME, logEntry.getLogName());
assertEquals(RESOURCE, logEntry.getResource());
assertEquals(Severity.DEFAULT, logEntry.getSeverity());
assertEquals(ImmutableMap.of(), logEntry.getLabels());
assertEquals(ImmutableMap.of(), logEntry.getLabels());
origin: googleapis/google-cloud-java

 private void compareLogEntry(LogEntry expected, LogEntry value) {
  assertEquals(expected, value);
  assertEquals(expected.getLogName(), value.getLogName());
  assertEquals(expected.getResource(), value.getResource());
  assertEquals(expected.getTimestamp(), value.getTimestamp());
  assertEquals(expected.getReceiveTimestamp(), value.getReceiveTimestamp());
  assertEquals(expected.getSeverity(), value.getSeverity());
  assertEquals(expected.getInsertId(), value.getInsertId());
  assertEquals(expected.getHttpRequest(), value.getHttpRequest());
  assertEquals(expected.getLabels(), value.getLabels());
  assertEquals(expected.getOperation(), value.getOperation());
  assertEquals(expected.getTrace(), value.getTrace());
  assertEquals(expected.getSpanId(), value.getSpanId());
  assertEquals(expected.getTraceSampled(), value.getTraceSampled());
  assertEquals(expected.getSourceLocation(), value.getSourceLocation());
  assertEquals(expected.getPayload(), value.getPayload());
  assertEquals(expected.hashCode(), value.hashCode());
 }
}
origin: googleapis/google-cloud-java

assertEquals(TIMESTAMP, (long) STRING_ENTRY.getTimestamp());
assertEquals(RECEIVE_TIMESTAMP, (long) STRING_ENTRY.getReceiveTimestamp());
assertEquals(SEVERITY, STRING_ENTRY.getSeverity());
assertEquals(INSERT_ID, STRING_ENTRY.getInsertId());
assertEquals(HTTP_REQUEST, STRING_ENTRY.getHttpRequest());
assertEquals(TIMESTAMP, (long) JSON_ENTRY.getTimestamp());
assertEquals(RECEIVE_TIMESTAMP, (long) JSON_ENTRY.getReceiveTimestamp());
assertEquals(SEVERITY, JSON_ENTRY.getSeverity());
assertEquals(INSERT_ID, JSON_ENTRY.getInsertId());
assertEquals(HTTP_REQUEST, JSON_ENTRY.getHttpRequest());
assertEquals(TIMESTAMP, (long) PROTO_ENTRY.getTimestamp());
assertEquals(RECEIVE_TIMESTAMP, (long) PROTO_ENTRY.getReceiveTimestamp());
assertEquals(SEVERITY, PROTO_ENTRY.getSeverity());
assertEquals(INSERT_ID, PROTO_ENTRY.getInsertId());
assertEquals(HTTP_REQUEST, PROTO_ENTRY.getHttpRequest());
assertEquals(TIMESTAMP, (long) logEntry.getTimestamp());
assertEquals(RECEIVE_TIMESTAMP, (long) logEntry.getReceiveTimestamp());
assertEquals(SEVERITY, logEntry.getSeverity());
assertEquals(INSERT_ID, logEntry.getInsertId());
assertEquals(HTTP_REQUEST, logEntry.getHttpRequest());
origin: googleapis/google-cloud-java

assertEquals(43, (long) logEntry.getTimestamp());
assertEquals(34, (long) logEntry.getReceiveTimestamp());
assertEquals(Severity.DEBUG, logEntry.getSeverity());
assertEquals("otherInsertId", logEntry.getInsertId());
assertEquals(request, logEntry.getHttpRequest());
origin: com.google.cloud/google-cloud-logging

public void write(Iterable<LogEntry> logEntries, WriteOption... options) {
 if (inWriteCall.get() != null) {
  return;
 }
 inWriteCall.set(true);
 try {
  writeLogEntries(logEntries, options);
  if (flushSeverity != null) {
   for (LogEntry logEntry : logEntries) {
    // flush pending writes if log severity at or above flush severity
    if (logEntry.getSeverity().compareTo(flushSeverity) >= 0) {
     flush();
     break;
    }
   }
  }
 } finally {
  inWriteCall.remove();
 }
}
com.google.cloud.loggingLogEntrygetSeverity

Javadoc

Returns the severity of the log entry. If not set, Severity#DEFAULT is used.

Popular methods of LogEntry

  • newBuilder
    Returns a builder for LogEntry objects given the entry payload.
  • getSpanId
    Returns the ID of the trace span associated with the log entry, if any.
  • getTrace
    Returns the resource name of the trace associated with the log entry, if any. If it contains a relat
  • fromPb
  • getTimestamp
    Returns the time at which the event described by the log entry occurred, in milliseconds. If omitted
  • getTraceSampled
    Returns the sampling decision of the trace span associated with the log entry, or falseif there is n
  • of
    Creates a LogEntry object given the log name, the monitored resource and the entry payload.
  • toBuilder
    Returns a Builder for this log entry.
  • toPb
  • toPbFunction
  • <init>
  • getHttpRequest
    Returns information about the HTTP request associated with this log entry, if applicable.
  • <init>,
  • getHttpRequest,
  • getInsertId,
  • getLabels,
  • getLocation,
  • getLogName,
  • getOperation,
  • getPayload,
  • getReceiveTimestamp

Popular in Java

  • Reactive rest calls using spring rest template
  • onRequestPermissionsResult (Fragment)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • putExtra (Intent)
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Logger (org.slf4j)
    The main user interface to logging. It is expected that logging takes place through concrete impleme
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now