Skip to content

Commit 6507a5d

Browse files
committed
ow
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
1 parent 79c1610 commit 6507a5d

File tree

4 files changed

+57
-62
lines changed

4 files changed

+57
-62
lines changed

src/site/pages/css/site3.css

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ div#top-content > #manualIndex {
237237
margin: 1rem;
238238
padding: 0px;
239239
background-color: #ffffff;
240-
Xfont-size: smaller;
241240
}
242241

243242

@@ -265,16 +264,13 @@ p.menu {
265264
padding-bottom: 0px;
266265
margin-top: 0px;
267266
margin-bottom: 0px;
268-
Xfont-size: smaller;
269267
}
270268

271269

272270
.headerline {
273271
background-color: #FFD0A0;
274272
border: 1px solid #CCCCCC;
275-
Xont-size: small;
276273
margin: 0px;
277-
278274
padding-top: 4px;
279275
}
280276

@@ -320,16 +316,14 @@ p.menu_header {
320316
border: none;
321317
margin-left: auto;
322318
margin-right: auto;
323-
324-
display: block;
319+
max-width: 100%;
325320
}
326321

327322
span.canonical {
328323
background: #fff;
329324
color: #0079C5;
330325
font-family: "Comic Sans MS", sans-serif;
331326
white-space: nowrap;
332-
Xfont-size: smaller;
333327

334328
border-top: 2px solid #DDD;
335329
border-left: 2px solid #DDD;

src/site/pages/legacy.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
<body onLoad="enableMenuEventListeners(); hljs.highlightAll(); decorate();">
1212

1313
<script src="templates/header3.js" type="text/javascript"></script>
14-
<div id="content">
14+
15+
16+
<div id="content">
1517

1618

1719
<h2>Bridging legacy APIs</h2>
@@ -35,9 +37,9 @@ <h2>Bridging legacy APIs</h2>
3537
<p></p>
3638

3739

38-
<p><a href="images/legacy.png">
40+
<a href="images/legacy.png">
3941
<img src="images/legacy.png" alt="click to enlarge" width="800"/>
40-
</a></p>
42+
</a>
4143

4244
<p>
4345
</p>

src/site/pages/manual.html

Lines changed: 49 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<div id="content">
1818

1919

20-
2120
<h2>SLF4J user manual</h2>
2221

2322
<p>The Simple Logging Facade for Java (SLF4J) serves as a simple
@@ -89,15 +88,16 @@ <h3 class="doAnchor" name="hello_world">Hello World</h3>
8988
logger is in turn used to log the message "Hello World".
9089
</p>
9190

92-
<pre class="prettyprint source">import org.slf4j.Logger;
91+
<pre><code>import org.slf4j.Logger;
9392
import org.slf4j.LoggerFactory;
9493

9594
public class HelloWorld {
95+
9696
public static void main(String[] args) {
9797
Logger logger = LoggerFactory.getLogger(HelloWorld.class);
9898
logger.info("Hello World");
9999
}
100-
}</pre>
100+
}</code></pre>
101101

102102
<p>To run this example, you first need to <a
103103
href="download.html">obtain slf4j</a> artifacts. Once that is
@@ -147,7 +147,7 @@ <h3 class="doAnchor" name="typical_usage">Typical usage
147147

148148
<p></p>
149149

150-
<pre class="prettyprint source"> 1: <b>import org.slf4j.Logger;</b>
150+
<pre><code> 1: <b>import org.slf4j.Logger;</b>
151151
2: <b>import org.slf4j.LoggerFactory;</b>
152152
3:
153153
4: public class Wombat {
@@ -167,7 +167,7 @@ <h3 class="doAnchor" name="typical_usage">Typical usage
167167
18: <b>logger.info("Temperature has risen above 50 degrees.");</b>
168168
19: }
169169
20: }
170-
21: } </pre>
170+
21: } </code></pre>
171171

172172

173173
<h3 class="doAnchor" name="fluent">Fluent Logging API</h3>
@@ -203,33 +203,32 @@ <h3 class="doAnchor" name="fluent">Fluent Logging API</h3>
203203
<p>Here are few usage examples:</p>
204204

205205
<p>The statement</p>
206-
<pre class="prettyprint source">logger.atInfo().log("Hello world.");</pre>
206+
<pre><code>logger.atInfo().log("Hello world.");</code></pre>
207207

208208
<p>is equivalent to:</p>
209209

210-
<pre class="prettyprint source">logger.info("Hello world.");</pre>
210+
<pre><code>logger.info("Hello world.");</code></pre>
211211

212212

213213
<p>The following log statements are equivalent in their output
214214
(for the default implementation):</p>
215215

216-
<pre class="prettyprint source">
217-
int newT = 15;
218-
int oldT = 16;
216+
<pre><code>int newT = 15;
217+
int oldT = 16;
219218

220-
// using traditional API
221-
logger.debug("Temperature set to {}. Old value was {}.", newT, oldT);
219+
// using traditional API
220+
logger.debug("Temperature set to {}. Old value was {}.", newT, oldT);
222221

223-
// using fluent API, log message with arguments
224-
logger.<b>atDebug()</b>.log("Temperature set to {}. Old value was {}.", newT, oldT);
225-
226-
// using fluent API, add arguments one by one and then log message
227-
logger.<b>atDebug()</b>.setMessage("Temperature set to {}. Old value was {}.").addArgument(newT).addArgument(oldT).<b>log()</b>;
222+
// using fluent API, log message with arguments
223+
logger.<b>atDebug()</b>.log("Temperature set to {}. Old value was {}.", newT, oldT);
224+
225+
// using fluent API, add arguments one by one and then log message
226+
logger.<b>atDebug()</b>.setMessage("Temperature set to {}. Old value was {}.").addArgument(newT).addArgument(oldT).<b>log()</b>;
228227

229-
// using fluent API, add one argument with a Supplier and then log message with one more argument.
230-
// Assume the method t16() returns 16.
231-
logger.<b>atDebug()</b>.setMessage("Temperature set to {}. Old value was {}.").addArgument(() -> t16()).addArgument(oldT).<b>log()</b>;
232-
</pre>
228+
// using fluent API, add one argument with a Supplier and then log message with one more argument.
229+
// Assume the method t16() returns 16.
230+
logger.<b>atDebug()</b>.setMessage("Temperature set to {}. Old value was {}.").addArgument(() -> t16()).addArgument(oldT).<b>log()</b>;
231+
</code></pre>
233232

234233
<p>The fluent logging API allows the specification of many
235234
different types of data to a <code>org.slf4j.Logger</code>
@@ -246,16 +245,15 @@ <h3 class="doAnchor" name="fluent">Fluent Logging API</h3>
246245

247246
<p>The following log statements are equivalent:</p>
248247

249-
<pre class="prettyprint source">
250-
int newT = 15;
251-
int oldT = 16;
248+
<pre><code>int newT = 15;
249+
int oldT = 16;
252250

253-
// using classical API
254-
logger.debug("oldT={} newT={} Temperature changed.", oldT, newT);
251+
// using classical API
252+
logger.debug("oldT={} newT={} Temperature changed.", oldT, newT);
255253

256-
// using fluent API
257-
logger.atDebug().setMessge("Temperature changed.").<b>addKeyValue("oldT", oldT)</b>.addKeyValue("newT", newT).log();
258-
</pre>
254+
// using fluent API
255+
logger.atDebug().setMessge("Temperature changed.").<b>addKeyValue("oldT", oldT)</b>.addKeyValue("newT", newT).log();
256+
</code></pre>
259257

260258
<p>The key-value pair variant of the API stores the key-value
261259
pairs as separates objects. The default implementation as
@@ -385,9 +383,9 @@ <h3 class="doAnchor" name="swapping">Binding with a logging
385383
<p>Here is a graphical illustration of the general idea.
386384
</p>
387385

388-
<p><a href="images/concrete-bindings.png">
389-
<img border="1" src="images/concrete-bindings.png" alt="click to enlarge" width="800"/>
390-
</a></p>
386+
<a href="images/concrete-bindings.png">
387+
<img src="images/concrete-bindings.png" alt="click to enlarge" width="800"/>
388+
</a>
391389

392390
<p>The SLF4J interfaces and their various adapters are extremely
393391
simple. Most developers familiar with the Java language should
@@ -473,11 +471,11 @@ <h3 class="doAnchor" name="projectDep">Declaring project
473471
</p>
474472

475473

476-
<pre class="prettyprint source">&lt;dependency>
474+
<pre><code>&lt;dependency>
477475
&lt;groupId>org.slf4j&lt;/groupId>
478476
&lt;artifactId>slf4j-api&lt;/artifactId>
479477
&lt;version>${latest.stable.version}&lt;/version>
480-
&lt;/dependency></pre>
478+
&lt;/dependency></code></pre>
481479

482480
<!-- ========================================================= -->
483481
<p><span class="label notice">logback-classic</span> <span
@@ -498,11 +496,11 @@ <h3 class="doAnchor" name="projectDep">Declaring project
498496
rule.
499497
</p>
500498

501-
<pre class="prettyprint source">&lt;dependency>
499+
<pre><code>&lt;dependency>
502500
&lt;groupId>ch.qos.logback&lt;/groupId>
503501
&lt;artifactId>logback-classic&lt;/artifactId>
504502
&lt;version>${logback-javax.version}&lt;/version>
505-
&lt;/dependency></pre>
503+
&lt;/dependency></code></pre>
506504

507505
<p/>
508506

@@ -528,11 +526,11 @@ <h3 class="doAnchor" name="projectDep">Declaring project
528526
mediation rule.
529527
</p>
530528

531-
<pre class="prettyprint source">&lt;dependency>
529+
<pre><code>&lt;dependency>
532530
&lt;groupId>ch.qos.logback&lt;/groupId>
533531
&lt;artifactId>logback-classic&lt;/artifactId>
534532
&lt;version>${logback-jakarta.version}&lt;/version>
535-
&lt;/dependency></pre>
533+
&lt;/dependency></code></pre>
536534

537535
<p/>
538536

@@ -552,11 +550,11 @@ <h3 class="doAnchor" name="projectDep">Declaring project
552550
by virtue of Maven's "nearest definition" dependency mediation
553551
rule.</p>
554552

555-
<pre class="prettyprint source">&lt;dependency>
553+
<pre><code>&lt;dependency>
556554
&lt;groupId>org.slf4j&lt;/groupId>
557555
&lt;artifactId>slf4j-reload4j&lt;/artifactId>
558556
&lt;version>${latest.stable.version}&lt;/version>
559-
&lt;/dependency></pre>
557+
&lt;/dependency></code></pre>
560558

561559

562560
<!-- ================================== -->
@@ -567,11 +565,11 @@ <h3 class="doAnchor" name="projectDep">Declaring project
567565
<code>org.slf4j:slf4j-reload4j</code> by virtue of Maven
568566
&lt;relocation&gt; directive. </p>
569567

570-
<pre class="prettyprint source">&lt;dependency>
568+
<pre><code>&lt;dependency>
571569
&lt;groupId>org.slf4j&lt;/groupId>
572570
&lt;artifactId>slf4j-log4j12&lt;/artifactId>
573571
&lt;version>${latest.stable.version}&lt;/version>
574-
&lt;/dependency></pre>
572+
&lt;/dependency></code></pre>
575573

576574
<p/>
577575

@@ -590,11 +588,11 @@ <h3 class="doAnchor" name="projectDep">Declaring project
590588
by virtue of Maven's "nearest definition" dependency mediation
591589
rule.</p>
592590

593-
<pre class="prettyprint source">&lt;dependency>
591+
<pre><code>&lt;dependency>
594592
&lt;groupId>org.slf4j&lt;/groupId>
595593
&lt;artifactId>slf4j-jdk14&lt;/artifactId>
596594
&lt;version>${latest.stable.version}&lt;/version>
597-
&lt;/dependency></pre>
595+
&lt;/dependency></code></pre>
598596

599597
<!-- ================================== -->
600598

@@ -611,11 +609,11 @@ <h3 class="doAnchor" name="projectDep">Declaring project
611609
by virtue of Maven's "nearest definition" dependency mediation
612610
rule.</p>
613611

614-
<pre class="prettyprint source">&lt;dependency>
612+
<pre><code>&lt;dependency>
615613
&lt;groupId>org.slf4j&lt;/groupId>
616614
&lt;artifactId>slf4j-simple&lt;/artifactId>
617615
&lt;version>${latest.stable.version}&lt;/version>
618-
&lt;/dependency></pre>
616+
&lt;/dependency></code></pre>
619617

620618
<!-- =========================================================== -->
621619

@@ -683,11 +681,11 @@ <h3 class="doAnchor" name="jep264">Support for JDK Platform Logging (JEP 264)
683681
href="http://openjdk.java.net/jeps/264">JDK Platform
684682
Logging</a>. </p>
685683

686-
<pre class="prettyprint source">&lt;dependency>
684+
<pre><code>&lt;dependency>
687685
&lt;groupId>org.slf4j&lt;/groupId>
688686
&lt;artifactId>slf4j-jdk-platform-logging&lt;/artifactId>
689687
&lt;version>${latest.2.version}&lt;/version>
690-
&lt;/dependency></pre>
688+
&lt;/dependency></code></pre>
691689

692690

693691

@@ -722,7 +720,8 @@ <h3 class="doAnchor" name="mdc">Mapped Diagnostic Context (MDC) support</h3>
722720

723721

724722
<h3 class="doAnchor" name="summary">Executive summary</h3>
725-
723+
724+
<div clas="bodyTable">
726725
<table class="bodyTable striped" cellspacing="4" cellpadding="4">
727726
<tr>
728727
<th align="left">Advantage</th>
@@ -797,9 +796,7 @@ <h3 class="doAnchor" name="summary">Executive summary</h3>
797796
href="faq.html#logging_performance">improved performance</a>
798797
results.</td>
799798
</tr>
800-
801-
802-
</table>
799+
</table></div>
803800

804801
<script src="templates/footer.js" type="text/javascript"></script>
805802

src/site/pages/templates/header3.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ document.write('<div id="header">');
6464

6565
document.write('<link rel="stylesheet" type="text/css" href="'+prefix+'css/site3.css"/>');
6666
document.write('<link rel="stylesheet" type="text/css" href="'+prefix+'css/menu2.css"/>');
67+
document.write('<link rel="stylesheet" type="text/css" href="'+prefix+'css/stackoverflow-light.min.css"/>');
68+
6769
document.write('<link rel="stylesheet" type="text/css" href="'+prefix+'css/font/fontawesome.min.css"/>');
6870
document.write('<link rel="stylesheet" type="text/css" href="'+prefix+'css/font/brands.min.css"/>');
6971
document.write('<link rel="stylesheet" type="text/css" href="'+prefix+'css/font/solid.min.css"/>');

0 commit comments

Comments
 (0)