Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>vscode-cm-magento2-snippetNew to Visual Studio Code? Get it now.
vscode-cm-magento2-snippet

vscode-cm-magento2-snippet

tvthu

|
202 installs
| (0) | Free
Some snippets for Magneto2 developers
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

A nice start to a collection of Magento 2 code snippets for Visual Studio Code!

Visual Studio Marketplace Version Visual Studio Marketplace Installs Visual Studio Marketplace Downloads Visual Studio Marketplace Rating Visual Studio Marketplace Rating (Stars)

Table of Contents

Logs

Logs
  • Log with Object Manager
  • Log with File content

Logs

Log Instructions

Log With Objectmanager

Trigger: m2.log.objectmanager

Output:

\Magento\Framework\App\ObjectManager::getInstance()->get(\Psr\Log\LoggerInterface::class)->debug(__FILE__ .':' . __LINE__);
\Magento\Framework\App\ObjectManager::getInstance()->get(\Psr\Log\LoggerInterface::class)->debug(json_encode(context));

Log With File content

Trigger: m2.log.putcontent

Output:

file_put_contents('var/log/custom.log', __FILE__ .':' . __LINE__ . PHP_EOL, FILE_APPEND);
file_put_contents('var/log/custom.log', context . PHP_EOL, FILE_APPEND);

Module

Trigger: m2.module.sequence

Output:

<sequence>
  <module name="Vendor_Module" />
</sequence>
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft