protected function format ($msg)
  {
    if (is_string ($msg)) {
      do {
        $msg = preg_replace_callback ('~
<\#(\w+)                            # capture LOG MARKUP TAG (ex: <#tag -> tag)
\s* (?: \| ([^>]+) )?               # capture optional tag arguments  (ex: <#tag|a|b|c> -> a|b|c)
>
(                                   # capture the tag\'s content
  (?:                               # begin loop
    (?= <\#\1 [ \s\|> ] )           # either the same tag is opened again (<#tag> <#tag| or <#tag(space))
    (?R)                            # and we must recurse
  |                                 # or
    .*?                             # capture everything
    (?= </\#\1> | <\#\1 [ \s\|> ] ) # until a closing/opening tag with the same name occurs
  )*                                # repeat loop
)                                   # end capture
</\#\1>                             # consume closing tag
~sx', function ($m) {
          list ($all, $tag, $args, $str) = $m;
          $args = $args ? explode ('|', $args) : [];
          switch ($tag) {
            case 'i':
              return "<div class='__log-item " . get ($args, 0) . "'>$str</div>";
            case 'row':
              return "<div class='__log-item __rowHeader " . get ($args, 0) . "'>$str</div>";
            case 'section':
              return "<div class='__log-section'>" . ($args ? "<div class='__log-title'>$args[0]</div>" : '') .
                     "$str</div>";
            case 'log':
              return "<div class='__log-stripe'>$str</div>";
            case 'data':
              return "<div class='__log-data'>$str</div>";
            case 'header':
              return "<div class='__header'>$str</div>";
            case 'footer':
              return "<div class='__footer'>$str</div>";
            case 'alert':
              return "<div class='__alert'>$str</div>";
            case 'type':
              $type = Debug::shortenType ($str);
              return "<span class='__type'>$type</span>";
            case 'indent':
              return "<div class='indent'>$str</div>";
            default:
              ob_clean ();
              throw new \RuntimeException("Invalid log tag <#$tag>");
          }
        }, $msg, -1, $count);
      } while ($count);
    }
    return $msg;
  }
protected function format ($msg)
  {
    if (is_string ($msg)) {
      do {
        $msg = preg_replace_callback ('~
<\#(\w+)                            # capture LOG MARKUP TAG (ex: <#tag -> tag)
\s* (?: \| ([^>]+) )?               # capture optional tag arguments  (ex: <#tag|a|b|c> -> a|b|c)
>
(                                   # capture the tag\'s content
  (?:                               # begin loop
    (?= <\#\1 [ \s\|> ] )           # either the same tag is opened again (<#tag> <#tag| or <#tag(space))
    (?R)                            # and we must recurse
  |                                 # or
    .*?                             # capture everything
    (?= </\#\1> | <\#\1 [ \s\|> ] ) # until a closing/opening tag with the same name occurs
  )*                                # repeat loop
)                                   # end capture
</\#\1>                             # consume closing tag
~sx', function ($m) {
          list ($all, $tag, $args, $str) = $m;
          $args = $args ? explode ('|', $args) : [];
          switch ($tag) {
            case 'i':
              return "<div class='__log-item " . get ($args, 0) . "'>$str</div>";
            case 'row':
              return "<div class='__log-item __rowHeader " . get ($args, 0) . "'>$str</div>";
            case 'section':
              return "<div class='__log-section'>" . ($args ? "<div class='__log-title'>$args[0]</div>" : '') .
                     "$str</div>";
            case 'log':
              return "<div class='__log-stripe'>$str</div>";
            case 'data':
              return "<div class='__log-data'>$str</div>";
            case 'header':
              return "<div class='__header'>$str</div>";
            case 'footer':
              return "<div class='__footer'>$str</div>";
            case 'alert':
              return "<div class='__alert'>$str</div>";
            case 'type':
              $type = Debug::shortenType ($str);
              return "<span class='__type'>$type</span>";
            case 'indent':
              return "<div class='indent'>$str</div>";
            default:
              ob_clean ();
              throw new \RuntimeException("Invalid log tag <#$tag>");
          }
        }, $msg, -1, $count);
      } while ($count);
    }
    return $msg;
  }
protected function format ( $ msg ) { if ( is_string ( $ msg ) ) { do { $ msg = preg_replace_callback ( '~
<\#(\w+)                            # capture LOG MARKUP TAG (ex: <#tag -> tag)
\s* (?: \| ([^>]+) )?               # capture optional tag arguments  (ex: <#tag|a|b|c> -> a|b|c)
>
(                                   # capture the tag\'s content
  (?:                               # begin loop
    (?= <\#\1 [ \s\|> ] )           # either the same tag is opened again (<#tag> <#tag| or <#tag(space))
    (?R)                            # and we must recurse
  |                                 # or
    .*?                             # capture everything
    (?= </\#\1> | <\#\1 [ \s\|> ] ) # until a closing/opening tag with the same name occurs
  )*                                # repeat loop
)                                   # end capture
</\#\1>                             # consume closing tag
~sx' , function ( $ m ) { list ( $ all , $ tag , $ args , $ str ) = $ m ; $ args = $ args ? explode ( '|' , $ args ) : [ ] ; switch ( $ tag ) { case 'i' : return "<div class='__log-item " . get ( $ args , 0 ) . "'>$str</div>" ; case 'row' : return "<div class='__log-item __rowHeader " . get ( $ args , 0 ) . "'>$str</div>" ; case 'section' : return "<div class='__log-section'>" . ( $ args ? "<div class='__log-title'>$args[0]</div>" : '' ) . "$str</div>" ; case 'log' : return "<div class='__log-stripe'>$str</div>" ; case 'data' : return "<div class='__log-data'>$str</div>" ; case 'header' : return "<div class='__header'>$str</div>" ; case 'footer' : return "<div class='__footer'>$str</div>" ; case 'alert' : return "<div class='__alert'>$str</div>" ; case 'type' : $ type = Debug :: shortenType ( $ str ) ; return "<span class='__type'>$type</span>" ; case 'indent' : return "<div class='indent'>$str</div>" ; default : ob_clean ( ) ; throw new \ RuntimeException ( "Invalid log tag <#$tag>" ) ; } } , $ msg , - 1 , $ count ) ; } while ( $ count ) ; } return $ msg ; }
Renders log markup to HTML.

##### Syntax:
```
<#tag>text</#tag>
<#tag|arg1|...argN>text</#tag>
```
##### Supported tags:

<table>
<tr><td><kbd> &lt;#t> text &lt;/#t></kbd>                    <td> non-evaluated raw HTML text.
<tr><td><kbd> &lt;#i|CSS classes> text &lt;/#i></kbd>        <td> Log item. It adds spacing.
<tr><td><kbd> &lt;#row|CSS classes> text &lt;/#wor></kbd>    <td> A line of information, similar to #i, but with an
automatically numbered row header column.
<tr><td><kbd> &lt;#section|title> text &lt;/#section></kbd>  <td> A section box with an optional title.
<tr><td><kbd> &lt;#log> content &lt;/#log></kbd>             <td> Output content wrapped by a log stripe.
<tr><td><kbd> &lt;#data> data &lt;/#data></kbd>              <td> Format a data structure's textual
representation.
<tr><td><kbd> &lt;#header> text &lt;/#header></kbd>          <td> A subsection title.
<tr><td><kbd> &lt;#footer> text &lt;/#footer></kbd>          <td> Extra information, right aligned.
<tr><td><kbd> &lt;#alert> text &lt;/#alert></kbd>            <td> Warning message.
<tr><td><kbd> &lt;#type> text &lt;/#type></kbd>              <td> A colored short type name with more details on a
tooltip.
<tr><td><kbd> &lt;#indent> text &lt;/#indent></kbd>          <td> An indented block.
</table>

@param $msg
@return mixed
Renders log markup to HTML .