#[non_exhaustive]pub struct LogEntry {
pub name: String,
pub timestamp: Option<Timestamp>,
pub severity: LogSeverity,
pub http_request: Option<HttpRequest>,
pub trace: String,
pub insert_id: String,
pub labels: HashMap<String, String>,
pub operation: Option<LogEntryOperation>,
pub source_location: Option<LogEntrySourceLocation>,
pub payload: Option<Payload>,
/* private fields */
}Expand description
An individual log entry.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringRequired. The log to which this log entry belongs. Examples: "syslog",
"book_log".
timestamp: Option<Timestamp>The time the event described by the log entry occurred. If omitted, defaults to operation start time.
severity: LogSeverityThe severity of the log entry. The default value is
LogSeverity.DEFAULT.
http_request: Option<HttpRequest>Optional. Information about the HTTP request associated with this log entry, if applicable.
trace: StringOptional. Resource name of the trace associated with the log entry, if any.
If this field contains a relative resource name, you can assume the name is
relative to //tracing.googleapis.com. Example:
projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824
insert_id: StringA unique ID for the log entry used for deduplication. If omitted, the implementation will generate one based on operation_id.
labels: HashMap<String, String>A set of user-defined (key, value) data that provides additional information about the log entry.
operation: Option<LogEntryOperation>Optional. Information about an operation associated with the log entry, if applicable.
source_location: Option<LogEntrySourceLocation>Optional. Source code location information associated with the log entry, if any.
payload: Option<Payload>The log entry payload, which can be one of multiple types.
Implementations§
Source§impl LogEntry
impl LogEntry
pub fn new() -> Self
Sourcepub fn set_timestamp<T>(self, v: T) -> Self
pub fn set_timestamp<T>(self, v: T) -> Self
Sets the value of timestamp.
Sourcepub fn set_or_clear_timestamp<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_timestamp<T>(self, v: Option<T>) -> Self
Sets or clears the value of timestamp.
Sourcepub fn set_severity<T: Into<LogSeverity>>(self, v: T) -> Self
pub fn set_severity<T: Into<LogSeverity>>(self, v: T) -> Self
Sets the value of severity.
Sourcepub fn set_http_request<T>(self, v: T) -> Selfwhere
T: Into<HttpRequest>,
pub fn set_http_request<T>(self, v: T) -> Selfwhere
T: Into<HttpRequest>,
Sets the value of http_request.
Sourcepub fn set_or_clear_http_request<T>(self, v: Option<T>) -> Selfwhere
T: Into<HttpRequest>,
pub fn set_or_clear_http_request<T>(self, v: Option<T>) -> Selfwhere
T: Into<HttpRequest>,
Sets or clears the value of http_request.
Sourcepub fn set_insert_id<T: Into<String>>(self, v: T) -> Self
pub fn set_insert_id<T: Into<String>>(self, v: T) -> Self
Sets the value of insert_id.
Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sets the value of labels.
Sourcepub fn set_operation<T>(self, v: T) -> Selfwhere
T: Into<LogEntryOperation>,
pub fn set_operation<T>(self, v: T) -> Selfwhere
T: Into<LogEntryOperation>,
Sets the value of operation.
Sourcepub fn set_or_clear_operation<T>(self, v: Option<T>) -> Selfwhere
T: Into<LogEntryOperation>,
pub fn set_or_clear_operation<T>(self, v: Option<T>) -> Selfwhere
T: Into<LogEntryOperation>,
Sets or clears the value of operation.
Sourcepub fn set_source_location<T>(self, v: T) -> Selfwhere
T: Into<LogEntrySourceLocation>,
pub fn set_source_location<T>(self, v: T) -> Selfwhere
T: Into<LogEntrySourceLocation>,
Sets the value of source_location.
Sourcepub fn set_or_clear_source_location<T>(self, v: Option<T>) -> Selfwhere
T: Into<LogEntrySourceLocation>,
pub fn set_or_clear_source_location<T>(self, v: Option<T>) -> Selfwhere
T: Into<LogEntrySourceLocation>,
Sets or clears the value of source_location.
Sourcepub fn set_payload<T: Into<Option<Payload>>>(self, v: T) -> Self
pub fn set_payload<T: Into<Option<Payload>>>(self, v: T) -> Self
Sets the value of payload.
Note that all the setters affecting payload are mutually
exclusive.
Sourcepub fn proto_payload(&self) -> Option<&Box<Any>>
pub fn proto_payload(&self) -> Option<&Box<Any>>
The value of payload
if it holds a ProtoPayload, None if the field is not set or
holds a different branch.
Sourcepub fn set_proto_payload<T: Into<Box<Any>>>(self, v: T) -> Self
pub fn set_proto_payload<T: Into<Box<Any>>>(self, v: T) -> Self
Sets the value of payload
to hold a ProtoPayload.
Note that all the setters affecting payload are
mutually exclusive.
Sourcepub fn text_payload(&self) -> Option<&String>
pub fn text_payload(&self) -> Option<&String>
The value of payload
if it holds a TextPayload, None if the field is not set or
holds a different branch.
Sourcepub fn set_text_payload<T: Into<String>>(self, v: T) -> Self
pub fn set_text_payload<T: Into<String>>(self, v: T) -> Self
Sets the value of payload
to hold a TextPayload.
Note that all the setters affecting payload are
mutually exclusive.