You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+53-12Lines changed: 53 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Rozenn is a Flash/AS3 logging system strongly inspired by the famous `Log4J <htt
5
5
6
6
Installation
7
7
============
8
-
The best way to use Rozenn is by adding the provided SWC file to your project. But you can download source code and put it in your classpath.
8
+
The best way to install Rozenn is by adding the provided SWC file to your project. But you can download source code and put it in your classpath.
9
9
10
10
Usage
11
11
=====
@@ -16,15 +16,15 @@ The logger is the basic entity of the system logger. He is represented by the cl
16
16
17
17
::
18
18
19
-
package
20
-
{
21
-
import org.rozenn.Logger;
22
-
23
-
public class MyClass
19
+
package
24
20
{
25
-
private static var logger : Logger = Logger.getLogger(MyClass);
21
+
import org.rozenn.Logger;
22
+
23
+
public class MyClass
24
+
{
25
+
private static var logger : Logger = Logger.getLogger(MyClass);
26
+
}
26
27
}
27
-
}
28
28
29
29
As you can see the declaration of a logger is very simple. It is done by the static method **Logger.getLogger**. This one take parent class name as parameter. You can give a different name but it is preferable to use the class to be used by the system of hierarchy and configuration.
30
30
@@ -51,10 +51,10 @@ To log a message several methods of the Logger available to you:
51
51
52
52
::
53
53
54
-
logger.log(Level.DEBUG, "debug message");
55
-
56
-
// the same with debug method
57
-
logger.debug("debug message");
54
+
logger.log(Level.DEBUG, "debug message");
55
+
56
+
// the same with debug method
57
+
logger.debug("debug message");
58
58
59
59
60
60
Of course these two methods are applicable for the other 4 levels: **INFO**, **WARN**, **ERROR** and **FATAL**.
@@ -71,3 +71,44 @@ To date four implementations are provided with Rozenn:
71
71
* **org.rozenn.layout.FlashInspectorLayout** – Messages are sent to FlashInspector application developped by `Pablo Constantini <http://www.luminicbox.com/>`_.
72
72
* **org.rozenn.layout.FireBugLayout** – Messages are sent to the inevitable Firefox plugin `FireBug <http://getfirebug.com/>`_. Of course your SWF to be played with the browser, the messages appear in the module "Console" plugin.
73
73
74
+
Formatting messages
75
+
-------------------
76
+
Rozenn can format the logging messages. This action takes place before they are sent to a layout. The formatting of messages is done by classes implementing the interface **org.rozenn.formatter.IFormatter**. These objects are associated with the layouts.
77
+
78
+
Rozenn offers two formatters:
79
+
* **org.rozenn.formatter.SimpleFormatter** – A formatter very simple: it passes the message body to layout as that is.
80
+
* **org.rozenn.formatter.PatternFormatter** – This formatter is more advanced. Its constructor takes a pattern that will define the form that will take a message once sent to the layout.
0 commit comments