<commit_before>// #/logging
sammy.get
(
    /^#\/(logging)$/,
    function( context )
    {
        var content_element = $( '#content' );
        
        content_element
            .html( '<div id="logging"></div>' );

        $.ajax
        (
            {
                url : 'logging.json',
                dataType : 'json',
                context : $( '#logging', content_element ),
                beforeSend : function( xhr, settings )
                {
                    this
                        .html( '<div class="loader">Loading ...</div>' );
                },
                success : function( response, text_status, xhr )
                {
                    var logger = response.logger;

                    var loglevel = '<div class="loglevel %class%">' + "\n";
                    loglevel += '<a class="effective_level trigger"><span>%effective_level%</span></a>' + "\n";
                    loglevel += '<ul>' + "\n";

                    for( var key in response.levels )
                    {
                        var level = response.levels[key].esc();
                        loglevel += '<li class="' + level + '"><a>' + level + '</a></li>' + "\n";
                    }

                    loglevel += '<li class="UNSET"><a>UNSET</a></li>' + "\n";
                    loglevel += '</ul>' + "\n";
                    loglevel += '</div>';

                    var logger_tree = function( filter )
                    {
                        var logger_content = '';
                        var filter_regex = new RegExp( '^' + filter + '\\.\\w+$' );

                        for( var logger_name in logger )
                        {
                            var continue_matcher = false;

                            if( !filter )
                            {
                                continue_matcher = logger_name.indexOf( '.' ) !== -1;
                            }
                            else
                            {
                                continue_matcher = !logger_name.match( filter_regex );
                            }

                            if( continue_matcher )
                            {
                                continue;
                            }

                            var has_logger_instance = !!logger[logger_name];

                            var classes = [];

                            has_logger_instance
                                ? classes.push( 'active' )
                                : classes.push( 'inactive' );

                            logger_content += '<li class="jstree-leaf">';
                            logger_content += '<ins class="jstree-icon">&nbsp;</ins>';
                            logger_content += '<a class="trigger ' + classes.join( ' ' ) + '" ' + "\n" +
                                                 'title="' + logger_name.esc() + '"><span>' + "\n" +
                                                logger_name.split( '.' ).pop().esc() + "\n" +
                                              '</span></a>';

                            logger_content += loglevel
                                                .replace
                                                (
                                                    /%class%/g,
                                                    classes.join( ' ' )
                                                )
                                                .replace
                                                (
                                                    /%effective_level%/g,
                                                    has_logger_instance
                                                        ? logger[logger_name].effective_level
                                                        : 'null'
                                                );

                            var child_logger_content = logger_tree( logger_name );
                            if( child_logger_content )
                            {
                                logger_content += '<ul>';
                                logger_content += child_logger_content;
                                logger_content += '</ul>';
                            }

                            logger_content += '</li>';
                        }

                        return logger_content;
                    }

                    var logger_content = logger_tree( null );

                    this
                        .html( '<ul class="tree jstree">' + logger_content + '</ul>' );

                    $( 'li:last-child', this )
                        .addClass( 'jstree-last' );
                    
                    $( '.loglevel', this )
                        .each
                        (
                            function( index, element )
                            {
                                var element = $( element );
                                var effective_level = $( '.effective_level span', element ).text();

                                element
                                    .css( 'z-index', 800 - index );
                                
                                $( 'ul .' + effective_level, element )
                                    .addClass( 'selected' );
                            }<commit_msg>SOLR-3208: adding a note that the logging is just a stub...<commit_after>// #/logging
sammy.get
(
    /^#\/(logging)$/,
    function( context )
    {
        var content_element = $( '#content' );
        
        content_element
            .html( '<div id="logging"></div>' );

        $.ajax
        (
            {
                url : 'logging.json',
                dataType : 'json',
                context : $( '#logging', content_element ),
                beforeSend : function( xhr, settings )
                {
                    this
                        .html( '<div class="loader">Loading ...</div>' );
                },
                success : function( response, text_status, xhr )
                {
                    var logger = response.logger;

                    var loglevel = '<div class="loglevel %class%">' + "\n";
                    loglevel += '<a class="effective_level trigger"><span>%effective_level%</span></a>' + "\n";
                    loglevel += '<ul>' + "\n";

                    for( var key in response.levels )
                    {
                        var level = response.levels[key].esc();
                        loglevel += '<li class="' + level + '"><a>' + level + '</a></li>' + "\n";
                    }

                    loglevel += '<li class="UNSET"><a>UNSET</a></li>' + "\n";
                    loglevel += '</ul>' + "\n";
                    loglevel += '</div>';

                    var logger_tree = function( filter )
                    {
                        var logger_content = '';
                        var filter_regex = new RegExp( '^' + filter + '\\.\\w+$' );

                        for( var logger_name in logger )
                        {
                            var continue_matcher = false;

                            if( !filter )
                            {
                                continue_matcher = logger_name.indexOf( '.' ) !== -1;
                            }
                            else
                            {
                                continue_matcher = !logger_name.match( filter_regex );
                            }

                            if( continue_matcher )
                            {
                                continue;
                            }

                            var has_logger_instance = !!logger[logger_name];

                            var classes = [];

                            has_logger_instance
                                ? classes.push( 'active' )
                                : classes.push( 'inactive' );

                            logger_content += '<li class="jstree-leaf">';
                            logger_content += '<ins class="jstree-icon">&nbsp;</ins>';
                            logger_content += '<a class="trigger ' + classes.join( ' ' ) + '" ' + "\n" +
                                                 'title="' + logger_name.esc() + '"><span>' + "\n" +
                                                logger_name.split( '.' ).pop().esc() + "\n" +
                                              '</span></a>';

                            logger_content += loglevel
                                                .replace
                                                (
                                                    /%class%/g,
                                                    classes.join( ' ' )
                                                )
                                                .replace
                                                (
                                                    /%effective_level%/g,
                                                    has_logger_instance
                                                        ? logger[logger_name].effective_level
                                                        : 'null'
                                                );

                            var child_logger_content = logger_tree( logger_name );
                            if( child_logger_content )
                            {
                                logger_content += '<ul>';
                                logger_content += child_logger_content;
                                logger_content += '</ul>';
                            }

                            logger_content += '</li>';
                        }

                        return logger_content;
                    }

                    var logger_content = logger_tree( null );
                    
                    var warn = '<div>TODO, this is not yet implemented.  For now, use <a href="logging" style="color:00AA00;">the old logging UI</a></div><br/>'


                    this.html( warn + '<ul class="tree jstree">' + logger_content + '</ul>' );

                    $( 'li:last-child', this )
                        .addClass( 'jstree-last' );
                    
                    $( '.loglevel', this )
                        .each
                        (
                            function( index, element )
                            {
                                var element = $( element );
                                var effective_level = $( '.effective_level span', element ).text();

                                element
                                    .css( 'z-index', 800 - index );
                                
                                $( 'ul .' + effective_level, element )
                                    .addClass( 'selected' );
                            }
{'fraction_non_alphanumeric': 0.10710710710710711, 'fraction_numerical': 0.001456001456001456, 'mean_word_length': 0.6558686153382552, 'pattern_counts': {'":': 0, '<': 72, '<?xml version=': 0, '>': 72, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 74, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5379773', 'n_tokens_mistral': 2265, 'n_tokens_neox': 2093, 'n_words': 435}