{
  "doc": {
    "id": "api/commands/log",
    "title": "log | Cypress Documentation",
    "description": "Print a message to the Cypress Command Log.",
    "section": "api",
    "source_path": "/llm/markdown/api/commands/log.md",
    "version": "48b03b5502f7aea1d0454750cce208f775403542",
    "updated_at": "2026-05-20T19:00:20.270Z",
    "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-learn-about-subject-management",
        "text": "Yields Learn about subject management",
        "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-learn-about-chaining-commands",
        "text": "Requirements Learn about chaining commands",
        "level": 3
      },
      {
        "id": "api/commands/log#assertions-learn-about-assertions",
        "text": "Assertions Learn about assertions",
        "level": 3
      },
      {
        "id": "api/commands/log#timeouts-learn-about-timeouts",
        "text": "Timeouts Learn about 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 [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)\n\n*   `cy.log()` yields `null`.\n",
      "section": "api",
      "anchors": [
        "syntax"
      ],
      "path": "/llm/json/chunked/api/commands/log.json",
      "token_estimate": 83
    },
    {
      "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#rules",
      "doc_id": "api/commands/log",
      "heading": "Rules",
      "heading_level": 2,
      "content_markdown": "## Rules\n\n### Requirements [Learn about chaining commands](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Chains-of-Commands)\n\n*   `cy.log()` requires being chained off of `cy`.\n\n### Assertions [Learn about assertions](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions)\n\n*   `cy.log()` cannot have any assertions chained.\n\n### Timeouts [Learn about timeouts](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Timeouts)\n\n*   `cy.log()` cannot time out.\n",
      "section": "api",
      "anchors": [
        "rules"
      ],
      "path": "/llm/json/chunked/api/commands/log.json",
      "token_estimate": 51
    },
    {
      "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
    }
  ]
}