cvs: peardoc / manual.xml.in /en/core log.xml
| From: | Jon Parise | Date: | Sat, 05 Jan 2002 23:49:08 +0000 |
| Subject: | cvs: peardoc / manual.xml.in /en/core log.xml | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1840@lists.php.net to get a copy of this message | ||
jon Sat Jan 5 18:49:08 2002 EDT
Added files:
/peardoc/en/core log.xml
Modified files:
/peardoc manual.xml.in
Log:
Adding initial documentation for the Log classes.
This is still very much a work in progress. Contributions are welcome.
Index: peardoc/manual.xml.in
diff -u peardoc/manual.xml.in:1.10 peardoc/manual.xml.in:1.11
--- peardoc/manual.xml.in:1.10 Fri Jan 4 12:33:07 2002
+++ peardoc/manual.xml.in Sat Jan 5 18:49:08 2002
@@ -39,6 +39,7 @@
&core.pear;
&core.db;
&core.http;
+ &core.log;
</part>
<part id="packages">
Index: peardoc/en/core/log.xml
+++ peardoc/en/core/log.xml
<?xml encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<reference id="log">
<title>Logging functions</title>
<titleabbrev>PEAR Log</titleabbrev>
<partintro>
<simpara>
</simpara>
</partintro>
<refentry id="core.log.log">
<refnamediv>
<refname>Log</refname>
<refpurpose>Logging abstraction class</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>require_once "Log.php";</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<simpara>
Logging interface functions.
</simpara>
</refsect1>
<refsect1 id="core.log.log.factory">
<title>Log::factory</title>
<funcsynopsis>
<funcprototype>
<funcdef>object <function>Log::factory</function></funcdef>
<paramdef>string <parameter>log_type</parameter></paramdef>
<paramdef>string
<parameter><optional>log_name</optional></parameter></paramdef>
<paramdef>string
<parameter><optional>ident</optional></parameter></paramdef>
<paramdef>array
<parameter><optional>conf</optional></parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
Return a concrete Log instance of <parameter>log_type</parameter>.
</para>
</refsect1>
<refsect1 id="core.log.log.singleton">
<title>Log::singleton</title>
<funcsynopsis>
<funcprototype>
<funcdef>object <function>Log::singleton</function></funcdef>
<paramdef>string <parameter>log_type</parameter></paramdef>
<paramdef>string
<parameter><optional>log_name</optional></parameter></paramdef>
<paramdef>string
<parameter><optional>ident</optional></parameter></paramdef>
<paramdef>array
<parameter><optional>conf</optional></parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
Returns a reference to a concrete Log instance of
<parameter>log_type</parameter>, only creating a new instance if no Log
instance with the same parameters currently exists.
</para>
<para>
You should use this if there are multiple places you might create a
logger, you don't want to create multiple loggers, and you don't want to
check for the existance of one each time. The singleton pattern does all
the checking work for you.
</para>
<para>
<note>
<simpara>
You MUST call this method with the <literal>$var = &Log::singleton()
</literal>syntax.
Without the ampersand (&) in front of the method name, you will not
get a reference; you will get a copy.
</simpara>
</note>
</para>
</refsect1>
<refsect1 id="core.log.log.attach">
<title>Log::attach</title>
<funcsynopsis>
<funcprototype>
<funcdef><function>Log::attach</function></funcdef>
<paramdef>object <parameter>logObserver</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
Adds a <link linkend="core.log.observer">Log_Observer</link> instance to
the list of observers that are to be notified when a message is logged.
</para>
</refsect1>
<refsect1 id="core.log.log.detach">
<title>Log::detach</title>
<funcsynopsis>
<funcprototype>
<funcdef><function>Log::detach</function></funcdef>
<paramdef>object <parameter>logObserver</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
Removes a <link linkend="core.log.observer">Log_Observer</link> instance
from the list of observers.
</para>
</refsect1>
<refsect1 id="core.log.log.notifyall">
<title>Log::notifyAll</title>
<funcsynopsis>
<funcprototype>
<funcdef><function>Log::notifyAll</function></funcdef>
<paramdef>array <parameter>messageOb</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
Sends any <link linkend="core.log.observer">Log_Observer</link> objects
listening to this Log the message that was just logged.
</para>
</refsect1>
</refentry>
<refentry id="core.log.observer">
<refnamediv>
<refname>Log_Observer</refname>
<refpurpose>Log observer class</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>require_once "Log/Log_Observer.php";</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<simpara>
The Log_Observer class implements the Observer end of a Subject-Observer
pattern for watching log activity and taking actions when notable events
occur.
</simpara>
</refsect1>
<refsect1 id="core.log.observer.factory">
<title>Log_Observer::factory</title>
<funcsynopsis>
<funcprototype>
<funcdef>object <function>Log_Observer::factory</function></funcdef>
<paramdef>string <parameter>observer_type</parameter></paramdef>
<paramdef>integer
<parameter><optional>priority</optional></parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
Attempts to return a concrete Log_Observer instance of the specified
<parameter>observer_type</parameter>.
</para>
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->