|
Revision 16743, 0.6 kB
(checked in by nowelium, 4 months ago)
|
|
lang/io/Log4Io: パッケージに分けてみた
|
| Line | |
|---|
| 1 | Log4Io Layout := Object clone do ( |
|---|
| 2 | separator ::= "" |
|---|
| 3 | init := method(nil) |
|---|
| 4 | with := method() |
|---|
| 5 | format := method(event, |
|---|
| 6 | "" |
|---|
| 7 | ) |
|---|
| 8 | getSeparator := method(separator) |
|---|
| 9 | ) |
|---|
| 10 | |
|---|
| 11 | Log4Io SimpleLayout := Log4Io Layout clone do ( |
|---|
| 12 | with = method( |
|---|
| 13 | setSeparator("\n") |
|---|
| 14 | ) |
|---|
| 15 | |
|---|
| 16 | format = method(event, |
|---|
| 17 | event level asString .. " - " .. event message .. separator |
|---|
| 18 | ) |
|---|
| 19 | ) |
|---|
| 20 | |
|---|
| 21 | Log4Io BasicLayout := Log4Io Layout clone do( |
|---|
| 22 | with = method( |
|---|
| 23 | setSeparator("\n") |
|---|
| 24 | ) |
|---|
| 25 | |
|---|
| 26 | format = method(event, |
|---|
| 27 | event categoryName .. "~" .. event startTime asString .. "[" .. event level asString .. "]" .. event message .. separator |
|---|
| 28 | ) |
|---|
| 29 | ) |
|---|
| 30 | |
|---|