<?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: Akiko IKEHARA</title>
    <description>The latest articles on DEV Community by Akiko IKEHARA (@ikeakiko).</description>
    <link>https://dev.to/ikeakiko</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%2F566491%2Fe5937f88-3782-42f2-9308-f85aee7dc02e.jpg</url>
      <title>DEV Community: Akiko IKEHARA</title>
      <link>https://dev.to/ikeakiko</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ikeakiko"/>
    <language>en</language>
    <item>
      <title>Remove console logs in production build (Angular 2.x)</title>
      <dc:creator>Akiko IKEHARA</dc:creator>
      <pubDate>Mon, 27 Dec 2021 09:01:43 +0000</pubDate>
      <link>https://dev.to/ikeakiko/remove-console-logs-in-production-build-angular-2x-1b43</link>
      <guid>https://dev.to/ikeakiko/remove-console-logs-in-production-build-angular-2x-1b43</guid>
      <description>&lt;h3&gt;
  
  
  Problem / Goal
&lt;/h3&gt;

&lt;p&gt;For debugging, most of us often write console.log to enable us to analyze problems. &lt;br&gt;
But, it is might be dangerous because there is a risk of accidentally outputting confidential information (api key, password, etc).&lt;br&gt;
Therefor, we don't want to output console.log in production.&lt;/p&gt;
&lt;h3&gt;
  
  
  Solution Overview
&lt;/h3&gt;

&lt;p&gt;Override console.log method on a function that does nothing.&lt;br&gt;
(There is also another way that use webpack settings.)&lt;/p&gt;
&lt;h3&gt;
  
  
  Concrete Steps
&lt;/h3&gt;

&lt;p&gt;Override console.log method on a function that does nothing.&lt;/p&gt;

&lt;p&gt;app/main.ts&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (environment.production) {
  window.console.log = () =&amp;gt; {};
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>angular</category>
      <category>javascript</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
