<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: O psnyder</title>
    <description>The latest articles on DEV Community by O psnyder (@o_psnyder_f2633626039281a).</description>
    <link>https://dev.to/o_psnyder_f2633626039281a</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3430621%2Faa9ac1a2-78a2-4def-a22b-b120730c1fd5.jpg</url>
      <title>DEV Community: O psnyder</title>
      <link>https://dev.to/o_psnyder_f2633626039281a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/o_psnyder_f2633626039281a"/>
    <language>en</language>
    <item>
      <title>Debug Vue3 Faster with Logging Directives</title>
      <dc:creator>O psnyder</dc:creator>
      <pubDate>Tue, 12 Aug 2025 20:28:24 +0000</pubDate>
      <link>https://dev.to/o_psnyder_f2633626039281a/debug-vue3-faster-with-logging-directives-p1c</link>
      <guid>https://dev.to/o_psnyder_f2633626039281a/debug-vue3-faster-with-logging-directives-p1c</guid>
      <description>&lt;h2&gt;
  
  
  Make Debugging in Vue Less Painful with Vue Log Arsenal
&lt;/h2&gt;

&lt;p&gt;In many Vue projects, you end up spending more time than you’d like digging through Devtools to track down a specific piece of data. Or when you try to solve a bug you might repeatedly have to check the value of a property, when you’d rather just see the value instantly where and when it matters.&lt;/p&gt;

&lt;p&gt;That's why I built Vue Log Arsenal to make the whole debugging process faster. Instead of digging through the component tree or messing around with console.logs, you can just drop in a directive and see exactly what’s going on in your console.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v-log → Logs all reactive and computed properties in the component when the element loads.

v-log.propertyName → Logs just the property you name.

v-log-change → Logs all reactive and computed properties when any value changes.

v-log-change.propertyName → Logs just the named property when it changes.

v-log-click → Logs all reactive and computed properties when the element is clicked.

v-log-click.propertyName → Logs just the named property when the element is clicked.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Example 1: v-log-change
&lt;/h2&gt;

&lt;p&gt;You have a totalPrice property that updates whenever items are added or removed from an input in a form.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;input type="number" v-model="inventoryAmount" v-log-change.totalPrice&amp;gt;{{ totalPrice }}&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, every time totalPrice updates — whether from adding an item, removing one, or applying a discount — the new value is logged so you can spot the exact moment when something goes wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example 2: v-log
&lt;/h2&gt;

&lt;p&gt;Here’s a quick way to see the value of selectedUser only when a certain condition becomes true.&lt;br&gt;
Maybe you only care about the data when a user has admin privileges:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div v-if="isAdmin" v-log.selectedUser&amp;gt;
  &amp;lt;p&amp;gt;{{ selectedUser.name }}&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The log will only appear when isAdmin is true and this block is rendered. This is great for narrowing down noisy logs and focusing on values during specific app states.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example 3: v-log-click
&lt;/h2&gt;

&lt;p&gt;Want to log the state of all properties within a component when a user clicks a button? Just use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;button v-log-click @click="checkout"&amp;gt;
  Checkout
&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When clicked it will log the exact state of the component with all its data at that moment. Perfect for checking data before an AJAX call is performed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;npm install vue-log-arsenal&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Register it in your Vue 3 project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { createApp } from 'vue';
import App from './App.vue';
import VueLogArsenal from 'vue-log-arsenal';

createApp(App)
  .use(VueLogArsenal)
  .mount('#app');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fad1qskexqg5r1ihdaqn4.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fad1qskexqg5r1ihdaqn4.gif" alt="Vue log arsenal in action" width="904" height="486"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/MvdZon/Vue3-log-arsenal" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.npmjs.com/package/vue-log-arsenal" rel="noopener noreferrer"&gt;NPM&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vue</category>
      <category>javascript</category>
      <category>logging</category>
      <category>directive</category>
    </item>
  </channel>
</rss>
