Documentation for Jinni File: loq.pro
This is Loq4Jinni, a simple yet effective logger. You can use it in your programs e.g. by writing loq:print(info, write sth.) or loq:println(error, write sth. with automatic carriage return). One of the basic features of this logger allows switching the logging centrally without having to resort to switching on and off the stuff in every rsp. logging place! That is, you renew the \property file\ called loqProps which, for instance, is set to logActivity(none). In this case all the logging is completely switched off. For Loq4Jinni to work as desired one needs to configure it accordingly as follows:
Configuration: Thanks to separating the database part of loq.pro into another Jinni file the amount of setup effort is significantly reduced as follows:
- set the logger database module as desired by modifying the file loqProps.pro
- renew(loqProps,_)
- now you can already use the logger in your programs
Existing classes,modules or programs that contain loq statements need not be recompiled!
Authored by:
Date: June, 2003
- concat/3
- loq/0
this is a pure static class (i.e. a module ;) which can be accessed by simply calling loq:Amethod(...) where Amethod is any of the following methods implemented in this module e.g. loq:print(warn,Hi!)
- print/2
Forms: - print(+InputType,+Print)
prints all the levels that are in the hierarchy apart from the exceptions. So if InputType is in the hierarchy, Print is printed(without carriage return at the end). Print can be any atom that is printable with Jinnis print/1 primitive.
printc/2
Forms: printc(+InputType,+Print)
prints all the levels that are in the hierarchy apart from the exceptions. So if InputType is in the hierarchy, Print is printed. Print is a character list that is convertible into an atom with Jinnis atom_codes/2 primitive.
printcl/3
Forms: printcl(+InputType,+Label,+Print)
prints all the levels that are in the hierarchy apart from the exceptions. So if InputType is in the hierarchy, Print is printed(with carriage return at the end) prefixed by Label. Print is a character list that is convertible into an atom with Jinnis atom_codes/2 primitive.
printcln/2
Forms: printcln(+InputType,+Print)
prints all the levels that are in the hierarchy apart from the exceptions. So if InputType is in the hierarchy, Print is printed(with carriage return at the end). Print is a character list that is convertible into an atom with Jinnis atom_codes/2 primitive.
printl/3
Forms: printl(+InputType,+Label,+Print)
prints all the levels that are in the hierarchy apart from the exceptions. So if InputType is in the hierarchy, Print is printed(with carriage return at the end) prefixed by Label. Print can be any atom that is printable with Jinnis print/1 primitive.
println/2
Forms: println(+InputType,+Print)
prints all the levels that are in the hierarchy apart from the exceptions. So if InputType is in the hierarchy, Print is printed(with carriage return at the end). Print can be any atom that is printable with Jinnis print/1 primitive.
stats/1
Forms: stats(+InputType)
prints the current sizes of Jinnis symbol table, hash table, code table, global/local stack and trail. Usage example: loq:stats(info), loq:timeinitl(info,Enter println:),println(hallo!),loq:time(info,D),loq:stats(info). The computation and printing of these statistics is done depending on the provided activity level (InputType). This may help in providing further information should Jinni perform less efficiently than expected.
time/0
initializes the timer clock. Usage example: loq:time,println(hallo!),loq:time(info).
Note that a parameter that describes the activity level is not required because the initialization is so fast that it does not matter if it is done even when not required.
time/1
Forms: time(+InputType)
prints the amount of time passed (in seconds) since the last initialization of the timer clock. Usage example: loq:timeinitl(info,Enter println:),println(hallo!),loq:time(info).
The computation and printing of this time difference is done depending on the provided activity level (InputType).
timeinitl/2
Forms: timeinitl(+InputType,+Label)
initializes the timer clock. Usage example: loq:timeinitl(info,Enter println:),println(hallo!),loq:time(info).
This is a refinement of the simple time predicate. It allows printing a label just before the timer clock is initialized. This printing is done depending on the provided activity level(InputType).
timel/2
Forms: time(+InputType,+Label)
prints the labelled amount of time passed (in seconds) since the last initialization of the timer clock. Usage example:loq:timeinitl(info,Enter println:),println(hallo!),loq:time(info,Exit println:).
The computation and printing of this time difference is done depending on the provided activity level (InputType). This is a refinement of time/1. It allows prefixing the time print by a label which may be any kind of Jinni atom printable with its print/1 primitive.
JinniDoc © 2003-2005 Chico Toepfer