<commit_before><?php
namespace Phorever;

use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;

class Configuration implements ConfigurationInterface
{
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('phorever');

        $rootNode
            ->children()
                ->scalarNode('pidfile')
                    ->cannotBeEmpty()
                    ->defaultValue('./phorever.pid')
                ->end()
                ->scalarNode('timezone')
                    ->cannotBeEmpty()
                    ->defaultValue('UTC')
                ->end()
                ->scalarNode('tick')
                    ->cannotBeEmpty()
                    ->defaultValue(2)
                    ->validate()
                        ->ifTrue(function($value) {
                            return !is_int($value) || $value < 1;
                        })
                        ->thenInvalid("Tick must be an integer 1 or greater")
                    ->end()
                ->end()
                ->arrayNode('logging')
                    ->children()
                        ->scalarNode('directory')
                            ->defaultValue('./logs/')
                            ->cannotBeEmpty()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('processes')
                    ->prototype('array')
                        ->children()
                            //description & metadata
                            ->scalarNode('name')->cannotBeEmpty()->end()
                            ->arrayNode('roles')->prototype('scalar')->end()->end()
                            //process information
                            ->scalarNode('up')->isRequired()->cannotBeEmpty()->end()
                            //failure management
                            ->scalarNode('resurrect_after')->defaultValue(5)->end()
                            //clones
                            ->scalarNode('clones')->defaultValue(1)->end()
                            //log files
                            ->booleanNode('log_forwarding')->defaultValue(true)->end()
                            ->scalarNode('stdout_file')->defaultValue('%name%.log')->cannotBeEmpty()->end()
                            ->scalarNode('stderr_file')->defaultValue('%name%.err.log')->cannotBeEmpty()->end()
                        ->end()
                    ->end()
                ->end()
            ->end()
        ;

        return $treeBuilder;
    }
}<commit_msg>Default error log files are %processname%.err to differentiate from regular log files when using simple wildcard glob searching<commit_after><?php
namespace Phorever;

use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;

class Configuration implements ConfigurationInterface
{
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('phorever');

        $rootNode
            ->children()
                ->scalarNode('pidfile')
                    ->cannotBeEmpty()
                    ->defaultValue('./phorever.pid')
                ->end()
                ->scalarNode('timezone')
                    ->cannotBeEmpty()
                    ->defaultValue('UTC')
                ->end()
                ->scalarNode('tick')
                    ->cannotBeEmpty()
                    ->defaultValue(2)
                    ->validate()
                        ->ifTrue(function($value) {
                            return !is_int($value) || $value < 1;
                        })
                        ->thenInvalid("Tick must be an integer 1 or greater")
                    ->end()
                ->end()
                ->arrayNode('logging')
                    ->children()
                        ->scalarNode('directory')
                            ->defaultValue('./logs/')
                            ->cannotBeEmpty()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('processes')
                    ->prototype('array')
                        ->children()
                            //description & metadata
                            ->scalarNode('name')->cannotBeEmpty()->end()
                            ->arrayNode('roles')->prototype('scalar')->end()->end()
                            //process information
                            ->scalarNode('up')->isRequired()->cannotBeEmpty()->end()
                            //failure management
                            ->scalarNode('resurrect_after')->defaultValue(5)->end()
                            //clones
                            ->scalarNode('clones')->defaultValue(1)->end()
                            //log files
                            ->booleanNode('log_forwarding')->defaultValue(true)->end()
                            ->scalarNode('stdout_file')->defaultValue('%name%.log')->cannotBeEmpty()->end()
                            ->scalarNode('stderr_file')->defaultValue('%name%.err')->cannotBeEmpty()->end()
                        ->end()
                    ->end()
                ->end()
            ->end()
        ;

        return $treeBuilder;
    }
}
{'fraction_non_alphanumeric': 0.13458702064896755, 'fraction_numerical': 0.0018436578171091445, 'mean_word_length': 1.1076146076146076, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 125, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4529447', 'n_tokens_mistral': 1202, 'n_tokens_neox': 1119, 'n_words': 181}