{
  "$id": "https://firefox-ci-tc.services.mozilla.com/schemas/common/logs-reference-v0.json#",
  "$schema": "https://firefox-ci-tc.services.mozilla.com/schemas/common/metadata-metaschema.json#",
  "additionalProperties": false,
  "description": "Reference of messages output by structured logging",
  "metadata": {
    "name": "logs",
    "version": 0
  },
  "properties": {
    "$schema": {
      "description": "Link to schema for this reference. That is a link to this very document. Typically used to identify what kind of reference this file is.",
      "format": "uri",
      "title": "Log Message Reference",
      "type": "string"
    },
    "serviceName": {
      "description": "Name of the taskcluster service",
      "pattern": "^[a-z][a-z0-9_-]*$",
      "title": "Service Name",
      "type": "string"
    },
    "types": {
      "description": "Array of log message types",
      "items": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "description": "A description of this message type",
            "type": "string"
          },
          "fields": {
            "additionalProperties": true,
            "description": "The set of fields that will be in every instance of this message type. Mapping field name to description.",
            "type": "object"
          },
          "level": {
            "description": "Either \"any\" or the syslog level that this log will write at.",
            "enum": [
              "emerg",
              "alert",
              "crit",
              "err",
              "warning",
              "notice",
              "info",
              "debug",
              "any"
            ]
          },
          "name": {
            "description": "The service-specific name of this message type.",
            "pattern": "^[a-z][a-zA-Z0-9_]*",
            "type": "string"
          },
          "title": {
            "description": "A human-readable name for the message type.",
            "type": "string"
          },
          "type": {
            "description": "The \"type\" of the message will be in the top-level keys of a message under the name \"Type\".",
            "pattern": "^[a-z][a-z0-9.-_]*",
            "type": "string"
          },
          "version": {
            "description": "The version of the fields for this log type. Will increment for breaking changes.",
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "type",
          "title",
          "name",
          "level",
          "version",
          "description",
          "fields"
        ],
        "title": "Message Type",
        "type": "object"
      },
      "title": "Types",
      "type": "array",
      "uniqueItems": true
    }
  },
  "required": [
    "serviceName",
    "$schema",
    "types"
  ],
  "title": "Log Messages Reference File",
  "type": "object"
}