title: Browsers: console groups
body: <p>I have this code:</p>
  
  <pre><code>console.log('before');
  
  console.groupCollapsed('main');
  console.log('test1')
  console.groupEnd();
  
  console.groupCollapsed('main');
  console.log('test2')
  console.groupEnd();
  
  console.groupCollapsed('main');
  console.log('test2')
  console.groupEnd();
  
  console.log('after');
  </code></pre>
  
  <p>It adds 3 lines to browser logs.<br>
  The problem is logs are splitted into 3 different groups.<br>
  Is it possible to append logs to previous group if previous log message and the current one have same group names (<code>main</code>)?</p>
  
  <p>So now output is:</p>
  
  <pre><code>before
  &gt; main
      test1
  &gt; main
      test2
  &gt; main
      test3
  after
  </code></pre>
  
  <p>and I want this output:</p>
  
  <pre><code>before
  &gt; main
      test1
      test2
      test3
  after
  </code></pre>
  
  <p><strong>Update</strong>: Code is async. So I should close the groups after logging to prevent logging from outside the groups to groups.</p>