cvs: peardoc /ja/core log.xml /ja/packages log.xml

From: Date: Sat, 09 Feb 2002 14:10:23 +0000
Subject: cvs: peardoc /ja/core log.xml /ja/packages log.xml
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-2343@lists.php.net to get a copy of this message
mj Sat Feb 9 09:10:23 2002 EDT Added files: /peardoc/ja/packages log.xml Removed files: /peardoc/ja/core log.xml Log: * Move Log chapter in japanese documentation.

Index: peardoc/ja/packages/log.xml +++ peardoc/ja/packages/log.xml <?xml encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <reference id="packages.log"> <title>ロギング関数</title> <titleabbrev>PEARログ</titleabbrev> <partintro> <simpara> </simpara> </partintro> <refentry id="packages.log.container"> <refnamediv> <refname>ロギングコンテナ</refname> <refpurpose> <classname>Log</classname> は、複数のデータコンテナをサポートしま す。 </refpurpose> </refnamediv> <refsect1 id="packages.log.container.file"> <title>'file' - Log_file</title> <para> データをローカルファイルシステムの任意のファイルに保存します。 (localとは、PHPのファイルシステム関数によりアクセス可能な全てのファ イルを意味します) </para> </refsect1> <refsect1 id="packages.log.container.mcal"> <title>'mcal' - Log_mcal</title> <para> カレンダー関数にデータを保存します。この関数は、 <command>libmcal</command>と<command>mcal</command> PHP拡張モジュー ルを必要とします。 </para> </refsect1> <refsect1 id="packages.log.container.sql"> <title>'sql' - Log_sql</title> <para> <link linkend="core.db">PEAR::DB</link>を用いて データベースにデータを保存します。 </para> </refsect1> <refsect1 id="packages.log.container.syslog"> <title>'sql' - Log_syslog</title> <para> UNIXベースのシステムでは<command>syslog</command>、 Windows NT/2000/XPでは<command>イベントログ</command>を用いてデー タを保存します。 </para> </refsect1> </refentry> <refentry id="packages.log.init"> <refnamediv> <refname>初期化</refname> <refpurpose><classname>Log</classname>オブジェクトを作成する</refpurpose> </refnamediv> <refsect1> <title></title> <para> There are three possible methods to create a <classname>Log</classname> object. You can create a <classname>Log_</classname> object directly or call either the <link linkend="packages.log.log.singleton"><function> &amp;singleton</function></link> or the <link linkend="packages.log.log.factory"><function>factory</function> </link> method of the <classname>Log</classname> class. </para> <example> <title>初期化の例</title> <programlisting role="php"> <![CDATA[ // direct initialization of the 'file' container $log = new Log_file('log.txt', 'identity text'); // initialization of the 'file' container through factory() $log = Log::factory('file', 'log.txt', 'identity text'); // initialization of the 'file' container through singelton() $log = &Log::singelton('file', 'log.txt', 'identity text'); ]]> </programlisting> </example> <para> Directly initializing an instance of the <classname>Log</classname> is probably the easiest method to understand. </para> <para> The second two approaches make use of software engineering design patterns (the "factory" and "singleton" metaphors). </para> <para> Specifically, calling the <function>factory</function> method will create a new instance of one of the <classname>Log_</classname> subclasses. The type of subclass that is returned is specified by the first parameter (<parameter>log_type</parameter>) passed to the <function>factory</function> method. This approach effectively hides the subclasses while still allowing the programmer to request a concrete instance of a certain subclass. This is useful in cases where the subclass type needs to be chosen at runtime. </para> <para> The <function>factory</function> method must always be called using PHP's static method notation - <literal>Log::factory</literal>. </para> <para> The <function>singleton</function> method is identical to the <function>factory</function> method except that it guarantees that only a single instance of the requested <classname>Log_</classname> subclass exists. The <function>singleton</function> method bases each instance's uniqueness on the parameters used in the instance's creation. In other words, only one instance with a given set of creation parameters will ever be returned by the <function>singleton</function> method. The second invocation will simply return a reference to the existing instance. </para> <para> The <function>singleton</function> method must also be called statically. In addition, it requires PHP's reference notation - <literal>&amp;Log::singleton</literal>. </para> </refsect1> </refentry> <refentry id="packages.log.log"> <refnamediv> <refname>Log</refname> <refpurpose>ログ抽象化クラス</refpurpose> </refnamediv> <refsynopsisdiv> <synopsis>require_once "Log.php";</synopsis> </refsynopsisdiv> <refsect1> <title>説明</title> <simpara> Logging interface functions. </simpara> </refsect1> <refsect1 id="packages.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="packages.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 = &amp;Log::singleton() </literal>syntax. Without the ampersand (&amp;) in front of the method name, you will not get a reference; you will get a copy. </simpara> </note> </para> </refsect1> <refsect1 id="packages.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="packages.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="packages.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="packages.log.observer">Log_Observer</link> instance from the list of observers. </para> </refsect1> <refsect1 id="packages.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="packages.log.observer">Log_Observer</link> objects listening to this Log the message that was just logged. </para> </refsect1> </refentry> <refentry id="packages.log.observer"> <refnamediv> <refname>Log_Observer</refname> <refpurpose>Log観測クラス</refpurpose> </refnamediv> <refsynopsisdiv> <synopsis>require_once "Log/Log_Observer.php";</synopsis> </refsynopsisdiv> <refsect1> <title>説明</title> <simpara> Log_Observerクラスは、ログ処理を監視し、重要なイベントが発生した 場合に行動を起こすために、Subject-ObserverパターンのObserver側を 実装します。 </simpara> </refsect1> <refsect1 id="packages.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> 指定した<parameter>observer_type</parameter>の具体的な Log_Observerインスタンスを返します。 </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 -->
« previous php.pear.cvs (#2343) next »