<p dir="auto"><strong>Is your feature request related to a problem? Please describe.</strong></p>
<p dir="auto">1000's of warning messages on the console increase the memory usage of an app until the app crashes, and duplicate warning messages are not needed.  Also, the warning message are generated when a specific device doesn't have a specific capability, even though the functionality of the app works, but will cause the app to crash when running for a length of time because the extra warning console messages use up the memory.</p>
<p dir="auto"><strong>Describe the solution you'd like</strong></p>
<p dir="auto">I would like to request that all console messages ( log, info, warn, error ) be removed from the code and replaced by a console message handler that provides the option of setting the log level as well as options to remove duplicate messages and an option to pass a function to it for an alternative logging system to allow for logging systems such as Winston that allow for remote logging.</p>
<p dir="auto"><strong>Describe alternatives you've considered</strong></p>
<p dir="auto">Replacing the built-in console message functions is not a good solution.</p>
<p dir="auto"><strong>Additional context</strong></p>
<p dir="auto">This is an easy feature add, I could do it myself and submit a PR if I know it will get accepted.</p>
<h5 dir="auto">Description</h5>
<p dir="auto">The problem. Currently, if I want to import a file from <code class="notranslate">examples/js</code> to my three.js project (bundled with webpack or anything else like this)<br>
Let’s say I need OBJLoader. I have two ways:</p>
<ol dir="auto">
<li>
<p dir="auto">Download the file to my project. Modify it (add <code class="notranslate">require(“three”)</code>, add exporting data). - The problem is that this is really complex and is annoying when you have several projects. + when new version of three.js is out with latest fixes/changes - I need to repeat the process.</p>
</li>
<li>
<p dir="auto">Second way is to search npm if it already has a such module - but there we have several problems:</p>
<ul dir="auto">
<li>The script can be outdated / not compatible with latest version of three.js</li>
<li>Some modules want you to wrap it with THREE: <code class="notranslate">OBJLoader(THREE)</code> - which breaks the use of features like tree-shaking</li>
</ul>
</li>
</ol>
<h5 dir="auto">Solution</h5>
<p dir="auto">As a possible solution, we can wrap each js file in examples/ with <a href="https://github.com/umdjs/umd">UMD pattern</a>. We would be still able to use it with THREE from global variable, and be able to include them with npm:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import OBJLoader from ‘three/examples/js/loaders/OBJLoader’;"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-v">OBJLoader</span> <span class="pl-k">from</span> <span class="pl-s1">‘three</span><span class="pl-c1">/</span><span class="pl-s1">examples</span><span class="pl-c1">/</span><span class="pl-s1">js</span><span class="pl-c1">/</span><span class="pl-s1">loaders</span><span class="pl-c1">/</span><span class="pl-v">OBJLoader’</span><span class="pl-kos">;</span></pre></div>
<h5 dir="auto">Three.js version</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Dev</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> r87</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ...</li>
</ul>
<h5 dir="auto">Browser</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Chrome</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Firefox</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Internet Explorer</li>
</ul>
<h5 dir="auto">OS</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Windows</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> macOS</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Linux</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Android</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> iOS</li>
</ul>
<h5 dir="auto">Hardware Requirements (graphics card, VR Device, ...)</h5>