{
  "doc": {
    "id": "api/cypress-api/cypress-log",
    "title": "Cypress.log | Cypress Documentation",
    "description": "The internal API for controlling what gets printed to the Command Log of Cypress.",
    "section": "api",
    "source_path": "/llm/markdown/api/cypress-api/cypress-log.md",
    "version": "24a73f8a97175663aaffd3b016289fb2a523a4ea",
    "updated_at": "2026-05-14T20:17:33.301Z",
    "headings": [
      {
        "id": "api/cypress-api/cypress-log#cypress-log",
        "text": "Cypress.log",
        "level": 1
      },
      {
        "id": "api/cypress-api/cypress-log#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/cypress-api/cypress-log#arguments",
        "text": "Arguments",
        "level": 3
      },
      {
        "id": "api/cypress-api/cypress-log#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/cypress-api/cypress-log#see-also",
        "text": "See also",
        "level": 2
      }
    ]
  },
  "chunks": [
    {
      "id": "api/cypress-api/cypress-log#syntax",
      "doc_id": "api/cypress-api/cypress-log",
      "heading": "Syntax",
      "heading_level": 2,
      "content_markdown": "## Syntax\n\n```\nCypress.log(options)\n```\n\n### Arguments\n\n**options _(Object)_**\n\nPass in an options object to `Cypress.log()`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `$el` | `undefined` |  |\n| `name` | `name of the command` |  |\n| `displayName` | `name of the command` | Overrides `name` only for display purposes. |\n| `message` | `command args` |  |\n| `consoleProps` | `function() {}` |  |\n",
      "section": "api",
      "anchors": [
        "syntax"
      ],
      "path": "/llm/json/chunked/api/cypress-api/cypress-log.json",
      "token_estimate": 99
    },
    {
      "id": "api/cypress-api/cypress-log#arguments",
      "doc_id": "api/cypress-api/cypress-log",
      "heading": "Arguments",
      "heading_level": 3,
      "content_markdown": "### Arguments\n\n**options _(Object)_**\n\nPass in an options object to `Cypress.log()`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `$el` | `undefined` |  |\n| `name` | `name of the command` |  |\n| `displayName` | `name of the command` | Overrides `name` only for display purposes. |\n| `message` | `command args` |  |\n| `consoleProps` | `function() {}` |  |\n",
      "section": "api",
      "anchors": [
        "arguments"
      ],
      "path": "/llm/json/chunked/api/cypress-api/cypress-log.json",
      "token_estimate": 92
    },
    {
      "id": "api/cypress-api/cypress-log#examples",
      "doc_id": "api/cypress-api/cypress-log",
      "heading": "Examples",
      "heading_level": 2,
      "content_markdown": "## Examples\n\nWe want the Command Log and the console in the DevTools to log specific properties of our custom command.\n\n```\nCypress.Commands.add('setSessionStorage', (key, value) => {  // Turn off logging of the cy.window() to command log  cy.window({ log: false }).then((window) => {    window.sessionStorage.setItem(key, value)  })  const log = Cypress.log({    name: 'setSessionStorage',    // shorter name for the Command Log    displayName: 'setSS',    message: `${key}, ${value}`,    consoleProps: () => {      // return an object which will      // print to dev tools console on click      return {        Key: key,        Value: value,        'Session Storage': window.sessionStorage,      }    },  })})\n```\n\nThe code above displays in the Command Log as shown below, with the console properties shown on click of the command.\n",
      "section": "api",
      "anchors": [
        "examples"
      ],
      "path": "/llm/json/chunked/api/cypress-api/cypress-log.json",
      "token_estimate": 155
    }
  ]
}