root/trunk/examples/logging/SCRIPT.txt

Revision 4662, 1.1 KB (checked in by pmoura, 5 days ago)

Updated copyright notice.

  • Property svn:eol-style set to native
Line 
1================================================================
2Logtalk - Open source object-oriented logic programming language
3Release 2.35.0
4
5Copyright (c) 1998-2009 Paulo Moura.        All Rights Reserved.
6Logtalk is free software.  You can redistribute it and/or modify
7it under the terms of the "Artistic License 2.0" as published by
8The 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
222008/7/17-18:15:38 - start
23yes
24
25
26% add a new entry to the object log:
27
28| ?- object::add_log_entry('something interesting happens').
29
30yes
31
32
33% check current object log:
34
35| ?- object::print_log.
36
372008/7/17-18:15:38 - start
382008/7/17-18:18:10 - something interesting happens
39yes
40
41
42% in alternative, enumerate all log entries using backtracking:
43
44| ?- object::log_entry(Date, Entry).
45
46Date = 2008/7/17-8:15:38,
47Entry = start ;
48Date = 2008/7/17-8:18:0,
49Entry = 'something interesting happens'
50yes
Note: See TracBrowser for help on using the browser.