|
Revision 4662, 1.1 KB
(checked in by pmoura, 5 days ago)
|
|
Updated copyright notice.
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | ================================================================ |
|---|
| 2 | Logtalk - Open source object-oriented logic programming language |
|---|
| 3 | Release 2.35.0 |
|---|
| 4 | |
|---|
| 5 | Copyright (c) 1998-2009 Paulo Moura. All Rights Reserved. |
|---|
| 6 | Logtalk is free software. You can redistribute it and/or modify |
|---|
| 7 | it under the terms of the "Artistic License 2.0" as published by |
|---|
| 8 | The Perl Foundation. Consult the "LICENSE.txt" file for details. |
|---|
| 9 | ================================================================ |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | % start by loading the example: |
|---|
| 13 | |
|---|
| 14 | | ?- logtalk_load(logging(loader)). |
|---|
| 15 | ... |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | % the object log is automatically initialized when the object is loaded: |
|---|
| 19 | |
|---|
| 20 | | ?- object::print_log. |
|---|
| 21 | |
|---|
| 22 | 2008/7/17-18:15:38 - start |
|---|
| 23 | yes |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | % add a new entry to the object log: |
|---|
| 27 | |
|---|
| 28 | | ?- object::add_log_entry('something interesting happens'). |
|---|
| 29 | |
|---|
| 30 | yes |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | % check current object log: |
|---|
| 34 | |
|---|
| 35 | | ?- object::print_log. |
|---|
| 36 | |
|---|
| 37 | 2008/7/17-18:15:38 - start |
|---|
| 38 | 2008/7/17-18:18:10 - something interesting happens |
|---|
| 39 | yes |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | % in alternative, enumerate all log entries using backtracking: |
|---|
| 43 | |
|---|
| 44 | | ?- object::log_entry(Date, Entry). |
|---|
| 45 | |
|---|
| 46 | Date = 2008/7/17-8:15:38, |
|---|
| 47 | Entry = start ; |
|---|
| 48 | Date = 2008/7/17-8:18:0, |
|---|
| 49 | Entry = 'something interesting happens' |
|---|
| 50 | yes |
|---|