{
  "doc": {
    "id": "api/commands/log",
    "title": "cy.log()",
    "description": "Print a message to the Cypress Command Log.",
    "section": "api",
    "source_path": "/llm/markdown/api/commands/log.md",
    "version": "e6c8d867c21227247f14714fb5690c7c018983c5",
    "updated_at": "2026-08-08T12:39:37.868Z",
    "headings": [
      {
        "id": "api/commands/log#log",
        "text": "log",
        "level": 1
      },
      {
        "id": "api/commands/log#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/commands/log#usage",
        "text": "Usage",
        "level": 3
      },
      {
        "id": "api/commands/log#arguments",
        "text": "Arguments",
        "level": 3
      },
      {
        "id": "api/commands/log#yields",
        "text": "Yields",
        "level": 3
      },
      {
        "id": "api/commands/log#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/commands/log#message",
        "text": "Message",
        "level": 3
      },
      {
        "id": "api/commands/log#print-a-message-to-the-command-log",
        "text": "Print a message to the Command Log.",
        "level": 4
      },
      {
        "id": "api/commands/log#args",
        "text": "Args",
        "level": 3
      },
      {
        "id": "api/commands/log#print-a-message-with-arguments-to-the-command-log",
        "text": "Print a message with arguments to the Command Log.",
        "level": 4
      },
      {
        "id": "api/commands/log#rules",
        "text": "Rules",
        "level": 2
      },
      {
        "id": "api/commands/log#requirements",
        "text": "Requirements",
        "level": 3
      },
      {
        "id": "api/commands/log#assertions",
        "text": "Assertions",
        "level": 3
      },
      {
        "id": "api/commands/log#timeouts",
        "text": "Timeouts",
        "level": 3
      },
      {
        "id": "api/commands/log#command-log",
        "text": "Command Log",
        "level": 2
      },
      {
        "id": "api/commands/log#see-also",
        "text": "See also",
        "level": 2
      }
    ]
  },
  "chunks": [
    {
      "id": "api/commands/log#syntax",
      "doc_id": "api/commands/log",
      "heading": "Syntax",
      "heading_level": 2,
      "content_markdown": "## Syntax\n\n```\ncy.log(message)cy.log(message, args...)\n```\n\n### Usage\n\n**Correct Usage**\n\n```\ncy.log('created new user')\n```\n\n### Arguments\n\n**message _(String)_**\n\nMessage to be printed to Cypress Command Log. Accepts a Markdown formatted message.\n\n**args...**\n\nAdditional arguments to be printed to the Cypress Command Log. There is no limit to the number of arguments.\n\n### Yields\n\n*   `cy.log()` yields `null`.\n",
      "section": "api",
      "anchors": [
        "syntax"
      ],
      "path": "/llm/json/chunked/api/commands/log.json",
      "token_estimate": 77
    },
    {
      "id": "api/commands/log#arguments",
      "doc_id": "api/commands/log",
      "heading": "Arguments",
      "heading_level": 3,
      "content_markdown": "### Arguments\n\n**message _(String)_**\n\nMessage to be printed to Cypress Command Log. Accepts a Markdown formatted message.\n\n**args...**\n\nAdditional arguments to be printed to the Cypress Command Log. There is no limit to the number of arguments.\n",
      "section": "api",
      "anchors": [
        "arguments"
      ],
      "path": "/llm/json/chunked/api/commands/log.json",
      "token_estimate": 49
    },
    {
      "id": "api/commands/log#examples",
      "doc_id": "api/commands/log",
      "heading": "Examples",
      "heading_level": 2,
      "content_markdown": "## Examples\n\n### Message\n\n#### Print a message to the Command Log.\n\n```\ncy.click('Login')cy.log('Login successful')\n```\n\n### Args\n\n#### Print a message with arguments to the Command Log.\n\n```\ncy.log('events triggered', events)\n```\n",
      "section": "api",
      "anchors": [
        "examples"
      ],
      "path": "/llm/json/chunked/api/commands/log.json",
      "token_estimate": 44
    },
    {
      "id": "api/commands/log#command-log",
      "doc_id": "api/commands/log",
      "heading": "Command Log",
      "heading_level": 2,
      "content_markdown": "## Command Log\n\n**_Print messages with arguments to the Command Log._**\n\n```\ncy.log('log out any message we want here')cy.log('another message', ['one', 'two', 'three'])\n```\n\nThe commands above will display in the Command Log as:\n\nWhen clicking on `log` within the command log, the console outputs the following:\n",
      "section": "api",
      "anchors": [
        "command-log"
      ],
      "path": "/llm/json/chunked/api/commands/log.json",
      "token_estimate": 63
    }
  ]
}