Fix Scala API docs
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/20598dac Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/20598dac Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/20598dac Branch: refs/heads/LOG4J2-1010&LOG4J2-1447-injectable-contextdata&better-datastructure Commit: 20598dac93d149d4338d93e50c357a55dcc69251 Parents: c00ecb2 Author: Mikael Ståldal <mik...@staldal.nu> Authored: Mon Jun 27 13:49:41 2016 +0200 Committer: Mikael Ståldal <mik...@staldal.nu> Committed: Mon Jun 27 13:49:41 2016 +0200 ---------------------------------------------------------------------- log4j-api-scala_2.11/src/site/site.xml | 52 ----------------------- log4j-api-scala_2.11/src/site/xdoc/index.xml | 43 ------------------- src/site/xdoc/manual/scala-api.xml | 33 +++++++++----- 3 files changed, 23 insertions(+), 105 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/20598dac/log4j-api-scala_2.11/src/site/site.xml ---------------------------------------------------------------------- diff --git a/log4j-api-scala_2.11/src/site/site.xml b/log4j-api-scala_2.11/src/site/site.xml deleted file mode 100644 index f3c878f..0000000 --- a/log4j-api-scala_2.11/src/site/site.xml +++ /dev/null @@ -1,52 +0,0 @@ -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -<project name="Log4j Scala API" - xmlns="http://maven.apache.org/DECORATION/1.4.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/DECORATION/1.4.0 http://maven.apache.org/xsd/decoration-1.4.0.xsd"> - <body> - <links> - <item name="Apache" href="http://www.apache.org/" /> - <item name="Logging Services" href="http://logging.apache.org/"/> - <item name="Log4j" href="../index.html"/> - </links> - - <!-- Component-specific reports --> - <menu ref="reports"/> - - <!-- Overall Project Info --> - <menu name="Log4j Project Information" img="icon-info-sign"> - <item name="Dependencies" href="../dependencies.html" /> - <item name="Dependency Convergence" href="../dependency-convergence.html" /> - <item name="Dependency Management" href="../dependency-management.html" /> - <item name="Project Team" href="../team-list.html" /> - <item name="Mailing Lists" href="../mail-lists.html" /> - <item name="Issue Tracking" href="../issue-tracking.html" /> - <item name="Project License" href="../license.html" /> - <item name="Source Repository" href="../source-repository.html" /> - <item name="Project Summary" href="../project-summary.html" /> - </menu> - - <menu name="Log4j Project Reports" img="icon-cog"> - <item name="Changes Report" href="../changes-report.html" /> - <item name="JIRA Report" href="../jira-report.html" /> - <item name="Surefire Report" href="../surefire-report.html" /> - <item name="RAT Report" href="../rat-report.html" /> - </menu> - </body> -</project> http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/20598dac/log4j-api-scala_2.11/src/site/xdoc/index.xml ---------------------------------------------------------------------- diff --git a/log4j-api-scala_2.11/src/site/xdoc/index.xml b/log4j-api-scala_2.11/src/site/xdoc/index.xml deleted file mode 100644 index a8bf5ec..0000000 --- a/log4j-api-scala_2.11/src/site/xdoc/index.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<document> - <properties> - <title>Log4j 2 Scala API</title> - <author email="mi...@apache.org">Mikael Ståldal</author> - </properties> - - <body> - <section name="Log4j Scala 2 API"> - - <p> - A convenient Scala wrapper for the - <a href="../log4j-api/apidocs/org/apache/logging/log4j/Logger.html">Logger</a> - API. - </p> - - </section> - - <section name="Requirements"> - <p> - Log4j 2 Scala API is dependent on the Log4j 2 API, Scala runtime library and reflection. - </p> - </section> - - </body> -</document> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/20598dac/src/site/xdoc/manual/scala-api.xml ---------------------------------------------------------------------- diff --git a/src/site/xdoc/manual/scala-api.xml b/src/site/xdoc/manual/scala-api.xml index 660289e..4f3d994 100644 --- a/src/site/xdoc/manual/scala-api.xml +++ b/src/site/xdoc/manual/scala-api.xml @@ -20,7 +20,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd"> <properties> - <title>Log4j 2 API</title> + <title>Log4j 2 Scala API</title> <author email="mi...@apache.org">Mikael Ståldal</author> </properties> @@ -33,14 +33,22 @@ <a href="../log4j-api/apidocs/org/apache/logging/log4j/Logger.html">Logger</a> API. </p> + + <h4>Requirements</h4> + <p> + Log4j 2 Scala API is dependent on the Log4j 2 API, Scala runtime library and reflection. + It currently supports Scala 2.10 and 2.11. + </p> + <h4>Example</h4> <pre class="prettyprint linenums">import org.apache.logging.log4j.scala.Logging -class MyClass extends BaseClass with Logging { - def doStuff(): Unit = { - logger.info("Doing stuff") - } -}</pre> + class MyClass extends BaseClass with Logging { + def doStuff(): Unit = { + logger.info("Doing stuff") + } + } + </pre> <p> The output from the call to logger.info() will vary significantly depending on the configuration used. See the @@ -51,10 +59,13 @@ class MyClass extends BaseClass with Logging { <p> Frequently the purpose of logging is to provide information about what is happening in the system, which requires including information about the objects being manipulated. In Scala, you can use - <a href="http://docs.scala-lang.org/overviews/core/string-interpolation.html">string interpolation</a> + <a href="http://docs.scala-lang.org/overviews/core/string-interpolation.html">string interpolation + </a> to achieve this: </p> - <pre class="prettyprint">logger.debug(s"Logging in user ${user.getName} with birthday ${user.calcBirthday}")</pre> + <pre class="prettyprint"> + logger.debug(s"Logging in user ${user.getName} with birthday ${user.calcBirthday}") + </pre> <p> Since the Scala Logger is implemented with macros, the String construction and method invocations will only occur when debug logging is enabled. @@ -65,11 +76,13 @@ class MyClass extends BaseClass with Logging { Most logging implementations use a hierarchical scheme for matching logger names with logging configuration. In this scheme the logger name hierarchy is represented by '.' characters in the logger name, in a fashion very similar to the hierarchy used for Java/Scala package names. - The Logging trait will automatically name the Logger accordingly to the class it is being used in. + The <a href="../log4j-api-scala_2.11/scaladocs/index.html#org.apache.logging.log4j.scala.Logging">Logging trait</a> will automatically name the Logger accordingly to the class it is being used in. </p> <h4>ScalaDoc</h4> - <p><a href="../log4j-api-scala_2.11/scaladocs/index.html#org.apache.logging.log4j.scala.package">ScalaDoc</a>.</p> + <p> + <a href="../log4j-api-scala_2.11/scaladocs/index.html#org.apache.logging.log4j.scala.package">ScalaDoc</a>. + </p> </subsection> </section>