Skip to content

Commit

Permalink
[docs] Update the Logging capacity documentation.
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Aug 28, 2017
1 parent 97eed6a commit 98cafd7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Expand Up @@ -13,6 +13,7 @@ The built-in capacity `[:loggingcap]{Logging}` provides tools for printing messa
"[:fctwarning!](java.lang.Object, java.lang.Object[])",
"[:fctinfo](info)(java.lang.Object, java.lang.Object[])",
"[:fctdebug](debug)(java.lang.Object, java.lang.Object[])",
"[:fctgetlogger](getLogger) : java.util.logging.Logger",
"[:fctgetloglevel](getLogLevel) : int",
"[:fctsetloglevel](setLogLevel)(int)",
"[:fctiserrorlogenabled](isErrorLogEnabled) : boolean",
Expand Down Expand Up @@ -233,6 +234,21 @@ Example:
}
[:End:]

## Accessing to the backend logger

The [:loggingcap:] capacity is based on the logging system of run-time virtual machine.
The [:fctgetlogger:] function provides you the access to the backend logger that is associated to the agent.

[:Success:]
package io.sarl.docs.reference.bic
import java.util.logging.Logger
interface Tmp {
[:On]
def [:fctgetlogger!] : Logger
[:Off]
}
[:End:]



[:Include:](../../legal.inc)
Expand Up @@ -984,6 +984,7 @@ The code is self-explaining.
[:Success:]
package io.sarl.docs.tutorials.tinyMASSRE
import java.util.UUID
import java.util.logging.Logger
import io.sarl.core.Logging
interface AgentIdentifier {
def setStringRepresentation(a : String)
Expand Down Expand Up @@ -1023,6 +1024,9 @@ The code is self-explaining.
def setLogLevel(level : int) {
}

def getLogger : Logger {
null
}

def error(message : Object, exception : Throwable = null, parameters : Object*) {
System::out.println("[" + getId.getString + "] ERROR: " + message)
Expand Down

0 comments on commit 98cafd7

Please sign in to comment.