@@ -56,10 +56,8 @@ public class TylerModelInterpretationContext extends ModelInterpretationContext
5656 final public MethodSpec .Builder configureMethodSpecBuilder ;
5757 final public Map <String , MethodSpec .Builder > mapOfMethodSpecBuilders = new LinkedHashMap <>();
5858
59- final FieldSpec contextFieldSpec = FieldSpec .builder (LoggerContext .class , CONTEXT_FIELD_NAME , Modifier .PRIVATE )
60- .build ();
61- final ParameterSpec contextParameterSpec = ParameterSpec .builder (LoggerContext .class ,
62- LOGGER_CONTEXT_PARAMETER_NAME ).build ();
59+ final FieldSpec contextFieldSpec = FieldSpec .builder (LoggerContext .class , CONTEXT_FIELD_NAME , Modifier .PRIVATE ).build ();
60+ final ParameterSpec contextParameterSpec = ParameterSpec .builder (LoggerContext .class , LOGGER_CONTEXT_PARAMETER_NAME ).build ();
6361 final ParameterSpec levelParameterSpec = ParameterSpec .builder (Level .class , LEVEL_FIELD_NAME ).build ();
6462
6563 final List <StaticImportData > staticImportsList = new ArrayList <>();
@@ -79,64 +77,65 @@ TypeSpec.Builder initializeTylerConfiguratorTSB() {
7977 //MethodSpec setupLoggerMS = makeSetupLoggerMethodSpec();
8078
8179 TypeSpec .Builder tsb = TypeSpec .classBuilder (TylerConstants .TYLER_CONFIGURATOR ).addJavadoc ("""
82-
83- <p>This file was generated by logback-tyler version %s</p>
84-
85- <p>Eventual errors and warnings are appended at the end.</p>
86-
87- <p>You may experiment with logback.xml to Java translation, i.e.
88- TylerConfigurator generation, at the following URL:</p>
89-
90- <p> https://logback.qos.ch/translator/services/xml2Java.html </p>
91-
92- <p>This generated TylerConfigurator class is intended to be copied and integrated
93- into the user's project as a custom configurator. It will configure logback
94- without XML. You are free to rename TylerConfigurator as you wish.</p>
95-
96- <p>It requires logback-classic version %s or later at runtime.</p>
97-
98- <p>Custom configurators are looked up via Java's service-provide facility. If a
99- custom provider is found, it takes precedence over logback's own configurators,
100- e.g. DefaultJoranConfigurator.</p>
101-
102- <p>To install your custom configurator to your project, add a
103- provider-configuration file to the following path:</p>
104-
105- <pre> META-INF/services/ch.qos.logback.classic.spi.Configurator</pre>
106-
107- <p>This provider-configuration file should contain a line with the fully
108- qualified class name of your tyler configurator.</p>
109-
110- <p>See also item 1 of 'Configuration at initialization' section at </p>
111-
112- <p> https://logback.qos.ch/manual/configuration.html#auto_configuration</p>
113-
114- <p>With recent versions of logback and logback-tyler you can still
115- configure logger levels dynamically using properties files. Note that
116- configuration files in properties format can be watched for
117- changes. See the documentation on PropertiesConfigurator for more details.</p>
118-
119- <p>https://logback.qos.ch/manual/configuration.html#propertiesConfigurator</p>
120-
121- <p>Keep in mind that by integrating a .properties configuration file info
122- your tyler configurator, you can still change logger levels dynamically, without
123- redeploying your application.</p>
124-
125- """ .formatted (TYLER_VERSION , REQUIRED_LOGBACK_VERSION ))
126- .addSuperinterface (Configurator .class )
127- .superclass (TylerConfiguratorBase .class );
80+
81+ <p>This file was generated by logback-tyler version %s</p>
82+
83+ <p>Eventual errors and warnings are appended at the end.</p>
84+
85+ <p>You may experiment with logback.xml to Java translation, i.e.
86+ TylerConfigurator generation, at the following URL:</p>
87+
88+ <p> https://logback.qos.ch/translator/services/xml2Java.html </p>
89+
90+ <p>This generated TylerConfigurator class is intended to be copied and integrated
91+ into the user's project as a custom configurator. It will configure logback
92+ without XML. You are free to rename TylerConfigurator as you wish.</p>
93+
94+ <p>It requires logback-classic version %s or later at runtime.</p>
95+
96+ <p>Custom configurators are looked up via Java's service-provide facility. If a
97+ custom provider is found, it takes precedence over logback's own configurators,
98+ e.g. DefaultJoranConfigurator.</p>
99+
100+ <p>To install your custom configurator to your project, add a
101+ provider-configuration file to the following path:</p>
102+
103+ <pre> META-INF/services/ch.qos.logback.classic.spi.Configurator</pre>
104+
105+ <p>This provider-configuration file should contain a line with the fully
106+ qualified class name of your tyler configurator.</p>
107+
108+ <p>See also item 1 of 'Configuration at initialization' section at </p>
109+
110+ <p> https://logback.qos.ch/manual/configuration.html#auto_configuration</p>
111+
112+ <p>With recent versions of logback and logback-tyler you can still
113+ configure logger levels dynamically using properties files. Note that
114+ configuration files in properties format can be watched for
115+ changes. See the documentation on PropertiesConfigurator for more details.</p>
116+
117+ <p>https://logback.qos.ch/manual/configuration.html#propertiesConfigurator</p>
118+
119+ <p>Keep in mind that by integrating a .properties configuration file info
120+ your tyler configurator, you can still change logger levels dynamically, without
121+ redeploying your application.</p>
122+
123+ """ .formatted (TYLER_VERSION , REQUIRED_LOGBACK_VERSION ))
124+ .addSuperinterface (Configurator .class )
125+ .superclass (TylerConfiguratorBase .class )
126+ .addModifiers (Modifier .PUBLIC );
128127 return tsb ;
129128 }
130129
131130 private MethodSpec .Builder initializeConfigureMethodSpecBuilder () {
132131 MethodSpec .Builder msb = MethodSpec .methodBuilder (CONFIGURE_METHOD_NAME ).addJavadoc ("""
133- <p>This method performs configuration per {@link $T} interface.</p>
134-
135- <p>If <code>TylerConfigurator</code> is installed as a configurator service, this
136- method will be called by logback-classic during initialization.</p>
137- """ , Configurator .class ).addAnnotation (Override .class ).addModifiers (Modifier .PUBLIC )
138- . addParameter ( contextParameterSpec ) .returns (Configurator .ExecutionStatus .class )
139- .addStatement ("$N($N)" , TylerConfiguratorBase .SET_CONTEXT_METHOD_NAME , contextParameterSpec );
132+ <p>This method performs configuration per {@link $T} interface.</p>
133+
134+ <p>If <code>TylerConfigurator</code> is installed as a configurator service, this
135+ method will be called by logback-classic during initialization.</p>
136+ """ , Configurator .class ).addAnnotation (Override .class ).addModifiers (Modifier .PUBLIC ). addParameter ( contextParameterSpec )
137+ .returns (Configurator .ExecutionStatus .class )
138+ .addStatement ("$N($N)" , TylerConfiguratorBase .SET_CONTEXT_METHOD_NAME , contextParameterSpec );
140139
141140 return msb ;
142141 }
0 commit comments