Class Message

java.lang.Object
io.sentry.protocol.Message
All Implemented Interfaces:
JsonSerializable, JsonUnknown

public final class Message extends Object implements JsonUnknown, JsonSerializable
A log entry message.

A log message is similar to the `message` attribute on the event itself but can additionally hold optional parameters.

```json { "message": { "message": "My raw message with interpreted strings like %s", "params": ["this"] } } ```

```json { "message": { "message": "My raw message with interpreted strings like {foo}", "params": {"foo": "this"} } } ```

  • Constructor Details

    • Message

      public Message()
  • Method Details

    • getFormatted

      @Nullable public @Nullable String getFormatted()
    • setFormatted

      public void setFormatted(@Nullable @Nullable String formatted)
      Sets a formatted String
      Parameters:
      formatted - a formatted String
    • getMessage

      @Nullable public @Nullable String getMessage()
    • setMessage

      public void setMessage(@Nullable @Nullable String message)
    • getParams

      @Nullable public @Nullable List<String> getParams()
    • setParams

      public void setParams(@Nullable @Nullable List<String> params)
    • serialize

      public void serialize(@NotNull @NotNull ObjectWriter writer, @NotNull @NotNull ILogger logger) throws IOException
      Specified by:
      serialize in interface JsonSerializable
      Throws:
      IOException
    • getUnknown

      @Nullable public @Nullable Map<String,Object> getUnknown()
      Specified by:
      getUnknown in interface JsonUnknown
    • setUnknown

      public void setUnknown(@Nullable @Nullable Map<String,Object> unknown)
      Specified by:
      setUnknown in interface JsonUnknown