diff --git a/doc/user/configuration-reference.xml b/doc/user/configuration-reference.xml index 4398484ac8b8b66644556aeec236ee0953a728d7..367cc0bc4b9437fc9c173548fefae356b77daef3 100644 --- a/doc/user/configuration-reference.xml +++ b/doc/user/configuration-reference.xml @@ -542,7 +542,7 @@ tarantool: primary pri: 3301 adm: 3313</programlisting> <tbody> <row> - <entry>log_level</entry> + <entry xml:id="log_level" xreflabel="log_level">log_level</entry> <entry>integer</entry> <entry>5</entry> <entry><emphasis role="strong">yes</emphasis></entry> @@ -557,18 +557,16 @@ tarantool: primary pri: 3301 adm: 3313</programlisting> </row> <row> - <entry>logger</entry> + <entry xml:id="logger" xreflabel="logger">logger</entry> <entry>string</entry> <entry>null</entry> <entry>no</entry> <entry>By default, the log is sent to the standard error stream (<filename>stderr</filename>). If logger - is given a value, Tarantool creates a child process, - executes the command indicated by the value, and pipes its standard - output to the standard input of the created process. - Example setting: <command>tee -a - tarantool.log</command> (this will duplicate log output - to <filename>stdout</filename> and a log file). + is specified, the log is sent to the file named in the string. + Example setting: logger = 'tarantool.log' + (this will open tarantool.log for output on the + server's default directory). </entry> </row> diff --git a/doc/user/databases.xml b/doc/user/databases.xml index d3055c8976cc7bf269ac8ce99e644bab1d664ec2..57d031b544a35c7c63906bb4f41ebcf4613ac137 100644 --- a/doc/user/databases.xml +++ b/doc/user/databases.xml @@ -1871,7 +1871,7 @@ tarantool> <userinput>#t</userinput> </varlistentry> <varlistentry> <term> - <emphasis role="lua"> <replaceable>tuple-value</replaceable> : bsize()</emphasis> + <emphasis role="lua"> <replaceable>tuple-value</replaceable>:bsize()</emphasis> </term> <listitem> <para> @@ -1904,7 +1904,7 @@ tarantool> <userinput>t:bsize()</userinput> </varlistentry> <varlistentry> <term> - <emphasis role="lua">[ <replaceable>field-number</replaceable> ]</emphasis> + <emphasis role="lua"><replaceable>tuple-value</replaceable> [ <replaceable>field-number</replaceable> ]</emphasis> </term> <listitem> <para> @@ -1932,7 +1932,7 @@ tarantool> <userinput>t[2]</userinput> <varlistentry> <term> - <emphasis role="lua">find(<replaceable>[field-number,] field-value) or findall([field-number,] field-value</replaceable>)</emphasis> + <emphasis role="lua"><replaceable>tuple-value</replaceable>:find(<replaceable>[field-number,] field-value</replaceable>) or <replaceable>tuple-value</replaceable>:findall(<replaceable>[field-number,] field-value</replaceable>)</emphasis> </term> <listitem> <para> @@ -1974,7 +1974,7 @@ tarantool> <userinput>t:findall(2, 'a')</userinput> </varlistentry> <varlistentry> <term> - <emphasis role="lua">transform(<replaceable>start-field-number, fields-to-remove [, field-value ...]</replaceable>)</emphasis> + <emphasis role="lua"><replaceable>tuple-value</replaceable>:transform(<replaceable>start-field-number, fields-to-remove [, field-value ...]</replaceable>)</emphasis> </term> <listitem> <para> @@ -2007,7 +2007,7 @@ tarantool> <userinput>t:transform(2,2,'x')</userinput> <varlistentry> <term> - <emphasis role="lua">slice(<replaceable>start-field-number [, end-field-number]</replaceable>)</emphasis> + <emphasis role="lua"><replaceable>tuple-value</replaceable>:slice(<replaceable>start-field-number [, end-field-number]</replaceable>)</emphasis> </term> <listitem> <para> @@ -2039,7 +2039,7 @@ tarantool> <userinput>t:slice(2, 4)</userinput> </varlistentry> <varlistentry> <term> - <emphasis role="lua">unpack()</emphasis> + <emphasis role="lua"><replaceable>tuple-value</replaceable>:unpack()</emphasis> </term> <listitem> <para> @@ -2070,7 +2070,7 @@ tarantool> <userinput>t:unpack()</userinput> </varlistentry> <varlistentry> <term> - <emphasis role="lua">pairs()</emphasis> + <emphasis role="lua"><replaceable>tuple-value</replaceable>:pairs()</emphasis> </term> <listitem> <para> @@ -2487,7 +2487,7 @@ tarantool> <userinput>box.stat().DELETE -- a selected item of the table</userinp <varlistentry> <term><emphasis role="lua" xml:id="net.box.ping"> - conn:ping()</emphasis></term> + <replaceable>conn</replaceable>:ping()</emphasis></term> <listitem> <para> Execute a PING command. @@ -2501,7 +2501,7 @@ tarantool> <userinput>box.stat().DELETE -- a selected item of the table</userinp <varlistentry> <term><emphasis role="lua" xml:id="net.box.close"> - conn:close()</emphasis></term> + <replaceable>conn</replaceable>:close()</emphasis></term> <listitem> <para> Close a connection. @@ -2522,7 +2522,7 @@ tarantool> <userinput>box.stat().DELETE -- a selected item of the table</userinp <varlistentry> <term><emphasis role="lua" xml:id="net.box.select"> - conn.space.<replaceable>space-name</replaceable>:select{<replaceable>field-value</replaceable>, ...}</emphasis></term> + <replaceable>conn</replaceable>.space.<replaceable>space-name</replaceable>:select{<replaceable>field-value</replaceable>, ...}</emphasis></term> <listitem> <para> <code>conn.space.<replaceable>space-name</replaceable>:select{...}</code> is the remote-call equivalent of the local call @@ -2536,7 +2536,7 @@ tarantool> <userinput>box.stat().DELETE -- a selected item of the table</userinp <varlistentry> <term><emphasis role="lua" xml:id="net.box.insert"> - conn.space.<replaceable>space-name</replaceable>:insert{field-value, ...}</emphasis></term> + <replaceable>conn</replaceable>.space.<replaceable>space-name</replaceable>:insert{field-value, ...}</emphasis></term> <listitem> <para> <code>conn.space.<replaceable>space-name</replaceable>:insert(...)</code> is the remote-call equivalent of the local call @@ -2547,7 +2547,7 @@ tarantool> <userinput>box.stat().DELETE -- a selected item of the table</userinp <varlistentry> <term><emphasis role="lua" xml:id="net.box.replace"> - conn.space.<replaceable>space-name</replaceable>:replace{field-value, ...}</emphasis></term> + <replaceable>conn</replaceable>.space.<replaceable>space-name</replaceable>:replace{field-value, ...}</emphasis></term> <listitem> <para> <code>conn.space.<replaceable>space-name</replaceable>:replace(...)</code> is the remote-call equivalent of the local call @@ -2558,7 +2558,7 @@ tarantool> <userinput>box.stat().DELETE -- a selected item of the table</userinp <varlistentry> <term><emphasis role="lua" xml:id="net.box.update"> - conn.space.<replaceable>space-name</replaceable>:update(<replaceable>key</replaceable>, <replaceable>format</replaceable>, ...)</emphasis></term> + <replaceable>conn</replaceable>.space.<replaceable>space-name</replaceable>:update(<replaceable>key</replaceable>, <replaceable>format</replaceable>, ...)</emphasis></term> <listitem> <para> <code>conn.space.<replaceable>space-name</replaceable>:update(...)</code> is the remote-call equivalent of the local call @@ -2569,7 +2569,7 @@ tarantool> <userinput>box.stat().DELETE -- a selected item of the table</userinp <varlistentry> <term><emphasis role="lua" xml:id="net.box.delete"> - conn.space.<replaceable>space-name</replaceable>:delete{key}</emphasis></term> + <replaceable>conn</replaceable>.space.<replaceable>space-name</replaceable>:delete{key}</emphasis></term> <listitem> <para> <code>conn.space.<replaceable>space-name</replaceable>:delete{...}</code> is the remote-call equivalent of the local call @@ -2580,7 +2580,7 @@ tarantool> <userinput>box.stat().DELETE -- a selected item of the table</userinp <varlistentry> <term><emphasis role="lua" xml:id="net.box.call"> - conn:call(<replaceable>function-name</replaceable> [, <replaceable>arguments</replaceable>])</emphasis></term> + <replaceable>conn</replaceable>:call(<replaceable>function-name</replaceable> [, <replaceable>arguments</replaceable>])</emphasis></term> <listitem> <para> <code>conn:call('func', '1', '2', '3')</code> is the remote-call equivalent of <code>func('1', '2', '3')</code>. @@ -2594,7 +2594,7 @@ tarantool> <userinput>box.stat().DELETE -- a selected item of the table</userinp <varlistentry> <term><emphasis role="lua" xml:id="net.box.timeout"> - conn:timeout(<replaceable>timeout</replaceable>)</emphasis></term> + <replaceable>conn</replaceable>:timeout(<replaceable>timeout</replaceable>)</emphasis></term> <listitem> <para> <code>timeout(...)</code> is a wrapper which sets a timeout for the request that follows it. diff --git a/doc/user/stored-procedures.xml b/doc/user/stored-procedures.xml index 58316d104d4fdad4d2e9985e1017befdad78d44b..0aa7573a2dc6f05db9a127b0c7ffe4828e13707d 100644 --- a/doc/user/stored-procedures.xml +++ b/doc/user/stored-procedures.xml @@ -154,7 +154,8 @@ The included language processor is <link xlink:href="http://luajit.org/">LuaJIT< Major "built-in" components are: fibers, <link xlink:href="http://msgpack.org">MsgPack</link>, digest, JSON, <link xlink:href="http://en.wikipedia.org/wiki/Yaml">YAML</link>, -<link xlink:href="http://en.wikipedia.org/wiki/Inter-process_communication">IPC</link> , and box. +<link xlink:href="http://en.wikipedia.org/wiki/Inter-process_communication">IPC</link>, +fio, and box. </para> <para> @@ -226,7 +227,12 @@ underlying information about typing, arrays, and structures. <para> <emphasis>IPC</emphasis> is Inter-Process Communication. -this is useful for implementations of task queues and long polling. +This is useful for implementations of task queues and long polling. +</para> + +<para> +<emphasis>Fio</emphasis> is standard file IO, +adapted to work with Tarantool's fibers in a cooperative environment. </para> <para> @@ -453,7 +459,7 @@ Password is not valid <varlistentry> <term> - <emphasis role="lua">:isnil(<replaceable>uuid_with_type_cdata</replaceable>)</emphasis> + <emphasis role="lua"><replaceable>uuid_with_type_cdata</replaceable>:isnil()</emphasis> </term> <listitem> <para> @@ -1157,7 +1163,7 @@ the status is dead because the cancel worked.<programlisting> </listitem> </varlistentry> <varlistentry> - <term><emphasis role="lua">channel:put(<replaceable>message[, timeout]</replaceable>)</emphasis></term> + <term><emphasis role="lua"><replaceable>channel</replaceable>:put(<replaceable>message[, timeout]</replaceable>)</emphasis></term> <listitem> <para> Send a message using a channel. If the channel is full, @@ -1177,7 +1183,7 @@ the status is dead because the cancel worked.<programlisting> </listitem> </varlistentry> <varlistentry> - <term><emphasis role="lua">channel:close()</emphasis></term> + <term><emphasis role="lua"><replaceable>channel</replaceable>:close()</emphasis></term> <listitem> <para> Close the channel. All waiters in the channel will be @@ -1188,7 +1194,7 @@ the status is dead because the cancel worked.<programlisting> </listitem> </varlistentry> <varlistentry> - <term><emphasis role="lua">channel:get(<replaceable>[timeout]</replaceable>)</emphasis></term> + <term><emphasis role="lua"><replaceable>channel</replaceable>:get(<replaceable>[timeout]</replaceable>)</emphasis></term> <listitem> <para> Fetch a message from a channel. If the channel is empty, @@ -1211,7 +1217,7 @@ the status is dead because the cancel worked.<programlisting> </listitem> </varlistentry> <varlistentry> - <term><emphasis role="lua">channel:broadcast(<replaceable>message</replaceable>)</emphasis></term> + <term><emphasis role="lua"><replaceable>channel</replaceable>:broadcast(<replaceable>message</replaceable>)</emphasis></term> <listitem> <para> If the channel is empty, <code>channel:broadcast()</code> is equivalent to @@ -1225,7 +1231,7 @@ the status is dead because the cancel worked.<programlisting> </listitem> </varlistentry> <varlistentry> - <term><emphasis role="lua">channel:is_empty()</emphasis></term> + <term><emphasis role="lua"><replaceable>channel</replaceable>:is_empty()</emphasis></term> <listitem> <para> Check whether the specified channel is empty (has no messages). @@ -1236,7 +1242,7 @@ the status is dead because the cancel worked.<programlisting> </listitem> </varlistentry> <varlistentry> - <term><emphasis role="lua">channel:is_full()</emphasis></term> + <term><emphasis role="lua"><replaceable>channel</replaceable>:is_full()</emphasis></term> <listitem> <para> Check whether the specified channel is full. @@ -1247,7 +1253,7 @@ the status is dead because the cancel worked.<programlisting> </listitem> </varlistentry> <varlistentry> - <term><emphasis role="lua">channel:has_readers()</emphasis></term> + <term><emphasis role="lua"><replaceable>channel</replaceable>:has_readers()</emphasis></term> <listitem> <para> Check whether the specified channel is empty and has readers waiting @@ -1260,7 +1266,7 @@ the status is dead because the cancel worked.<programlisting> </listitem> </varlistentry> <varlistentry> - <term><emphasis role="lua">channel:has_writers()</emphasis></term> + <term><emphasis role="lua"><replaceable>channel</replaceable>:has_writers()</emphasis></term> <listitem> <para> Check whether the specified channel is full and has writers waiting @@ -1273,7 +1279,7 @@ the status is dead because the cancel worked.<programlisting> </listitem> </varlistentry> <varlistentry> - <term><emphasis role="lua">channel:is_closed()</emphasis></term> + <term><emphasis role="lua"><replaceable>channel</replaceable>:is_closed()</emphasis></term> <listitem> <simpara> Returns: (type = boolean) true if the specified channel is already @@ -1531,7 +1537,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-sysconnect" xreflabel="socket-sysconnect"><emphasis role="lua">sock:sysconnect(<replaceable>host, port</replaceable>)</emphasis></term> + <term xml:id="socket-sysconnect" xreflabel="socket-sysconnect"><emphasis role="lua"><replaceable>sock</replaceable>:sysconnect(<replaceable>host, port</replaceable>)</emphasis></term> <listitem> <para> Connect a socket to a remote host. @@ -1554,7 +1560,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-tcpconnect" xreflabel="socket-tcpconnect"><emphasis role="lua">sock:tcp_connect(<replaceable>host, port</replaceable>)</emphasis></term> + <term xml:id="socket-tcpconnect" xreflabel="socket-tcpconnect"><emphasis role="lua">socket.tcp_connect(<replaceable>host, port</replaceable>)</emphasis></term> <listitem> <para> Connect a socket to a remote host. @@ -1566,13 +1572,13 @@ end Returns: (type = userdata) a connected socket, if no error. </para> <para> - Example: <code>sock:tcp_connect('tarantool.org', 80)</code> + Example: <code>socket.tcp_connect('tarantool.org', 80)</code> </para> </listitem> </varlistentry> <varlistentry> - <term xml:id="socket-send" xreflabel="socket-send"><emphasis role="lua">sock:send(<replaceable>data</replaceable>)</emphasis></term> + <term xml:id="socket-send" xreflabel="socket-send"><emphasis role="lua"><replaceable>sock</replaceable>:send(<replaceable>data</replaceable>)</emphasis></term> <listitem> <para> Send data over a connected socket. @@ -1590,7 +1596,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-syswrite" xreflabel="socket-syswrite"><emphasis role="lua">sock:syswrite(<replaceable>size</replaceable>)</emphasis></term> + <term xml:id="socket-syswrite" xreflabel="socket-syswrite"><emphasis role="lua"><replaceable>sock</replaceable>:syswrite(<replaceable>size</replaceable>)</emphasis></term> <listitem> <para> Write as much as possible data to the socket buffer if non-blocking. @@ -1622,7 +1628,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-readline" xreflabel="socket-readline"><emphasis role="lua">sock:readline(<replaceable>[limit] [, separator list]</replaceable>)</emphasis></term> + <term xml:id="socket-readline" xreflabel="socket-readline"><emphasis role="lua"><replaceable>sock</replaceable>:readline(<replaceable>[limit] [, separator list]</replaceable>)</emphasis></term> <listitem> <para> Read a line from a connected socket. @@ -1669,7 +1675,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-read" xreflabel="socket-read"><emphasis role="lua">sock:read(<replaceable>size</replaceable>)</emphasis></term> + <term xml:id="socket-read" xreflabel="socket-read"><emphasis role="lua"><replaceable>sock</replaceable>:read(<replaceable>size</replaceable>)</emphasis></term> <listitem> <para> Read data on a socket, until <code>size</code> bytes have been read, @@ -1680,7 +1686,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-sysread" xreflabel="socket-sysread"><emphasis role="lua">sock:sysread(<replaceable>size</replaceable>)</emphasis></term> + <term xml:id="socket-sysread" xreflabel="socket-sysread"><emphasis role="lua"><replaceable>sock</replaceable>:sysread(<replaceable>size</replaceable>)</emphasis></term> <listitem> <para> Return all available data from the socket buffer if non-blocking. @@ -1690,7 +1696,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-bind" xreflabel="socket-bind"><emphasis role="lua">sock:bind(<replaceable>host, port</replaceable>)</emphasis></term> + <term xml:id="socket-bind" xreflabel="socket-bind"><emphasis role="lua"><replaceable>sock</replaceable>:bind(<replaceable>host, port</replaceable>)</emphasis></term> <listitem> <para> Bind a socket to the given host/port. @@ -1709,7 +1715,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-listen" xreflabel="socket-listen"><emphasis role="lua">sock:listen(backlog)</emphasis></term> + <term xml:id="socket-listen" xreflabel="socket-listen"><emphasis role="lua"><replaceable>sock</replaceable>:listen(backlog)</emphasis></term> <listitem> <para> Start listening for incoming connections. @@ -1726,7 +1732,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-accept" xreflabel="socket-accept"><emphasis role="lua">sock:accept()</emphasis></term> + <term xml:id="socket-accept" xreflabel="socket-accept"><emphasis role="lua"><replaceable>sock</replaceable>:accept()</emphasis></term> <listitem> <para> Accept a new client connection and create a new connected socket. @@ -1739,7 +1745,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-sendto" xreflabel="socket-sendto"><emphasis role="lua">sock:sendto(<replaceable>data, host, port</replaceable>)</emphasis></term> + <term xml:id="socket-sendto" xreflabel="socket-sendto"><emphasis role="lua"><replaceable>sock</replaceable>:sendto(<replaceable>data, host, port</replaceable>)</emphasis></term> <listitem> <para> Send a message on a UDP socket to a specified host. @@ -1755,7 +1761,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-recvfrom" xreflabel="socket-recvfrom"><emphasis role="lua">sock:recvfrom(<replaceable>limit</replaceable>)</emphasis></term> + <term xml:id="socket-recvfrom" xreflabel="socket-recvfrom"><emphasis role="lua"><replaceable>sock</replaceable>:recvfrom(<replaceable>limit</replaceable>)</emphasis></term> <listitem> <para> Receive a message on a UDP socket. @@ -1771,7 +1777,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-shutdown" xreflabel="socket-shutdown"><emphasis role="lua">sock:shutdown(<replaceable>how</replaceable>)</emphasis></term> + <term xml:id="socket-shutdown" xreflabel="socket-shutdown"><emphasis role="lua"><replaceable>sock</replaceable>:shutdown(<replaceable>how</replaceable>)</emphasis></term> <listitem> <para> Shutdown a reading end, a writing end, or both ends of a socket. @@ -1787,7 +1793,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-close" xreflabel="socket-close"><emphasis role="lua">sock:close()</emphasis></term> + <term xml:id="socket-close" xreflabel="socket-close"><emphasis role="lua"><replaceable>sock</replaceable>:close()</emphasis></term> <listitem> <para> Close (destroy) a socket. @@ -1803,7 +1809,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-error" xreflabel="socket-error"><emphasis role="lua">sock:error() and sock:errno()</emphasis></term> + <term xml:id="socket-error" xreflabel="socket-error"><emphasis role="lua"><replaceable>sock</replaceable>:error() and <replaceable>sock</replaceable>:errno()</emphasis></term> <listitem> <para> Retrieve information about the last error that occurred on a socket, if any. @@ -1819,7 +1825,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-setsockopt" xreflabel="socket-setsockopt"><emphasis role="lua">sock:setsockopt(<replaceable>level, name, value</replaceable>)</emphasis></term> + <term xml:id="socket-setsockopt" xreflabel="socket-setsockopt"><emphasis role="lua"><replaceable>sock</replaceable>:setsockopt(<replaceable>level, name, value</replaceable>)</emphasis></term> <listitem> <para> Set socket flags. The argument values are the same as in the <link xlink:href="http://man7.org/linux/man-pages/man2/setsockopt.2.html">Linux man page</link>. @@ -1835,7 +1841,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-getsockopt" xreflabel="socket-getsockopt"><emphasis role="lua">sock:getsockopt(<replaceable>level, name</replaceable>)</emphasis></term> + <term xml:id="socket-getsockopt" xreflabel="socket-getsockopt"><emphasis role="lua"><replaceable>sock</replaceable>:getsockopt(<replaceable>level, name</replaceable>)</emphasis></term> <listitem> <para> Get socket flags. For a list of possible flags see description of the previous function, @@ -1845,7 +1851,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-linger" xreflabel="socket-linger"><emphasis role="lua">sock:linger([<replaceable>active</replaceable>])</emphasis></term> + <term xml:id="socket-linger" xreflabel="socket-linger"><emphasis role="lua"><replaceable>sock</replaceable>:linger([<replaceable>active</replaceable>])</emphasis></term> <listitem> <para> Set or clear the SO_LINGER flag. For a description of the flag, see <link xlink:href="http://man7.org/linux/man-pages/man1/loginctl.1.html">Linux man page</link>. @@ -1860,7 +1866,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-nonblock" xreflabel="socket-nonblock"><emphasis role="lua">sock:nonblock([<replaceable>flag</replaceable>])</emphasis></term> + <term xml:id="socket-nonblock" xreflabel="socket-nonblock"><emphasis role="lua"><replaceable>sock</replaceable>:nonblock([<replaceable>flag</replaceable>])</emphasis></term> <listitem> <para> <code>sock:nonblock()</code> returns the current flag value. @@ -1872,7 +1878,7 @@ end </varlistentry> <varlistentry> - <term xml:id="socket-readable" xreflabel="socket-readable"><emphasis role="lua">sock:readable([<replaceable>timeout</replaceable>])</emphasis>, <emphasis>sock:writable([<replaceable>timeout</replaceable>])</emphasis>, <emphasis>sock:wait([<replaceable>timeout</replaceable>])</emphasis></term> + <term xml:id="socket-readable" xreflabel="socket-readable"><emphasis role="lua"><replaceable>sock</replaceable>:readable([<replaceable>timeout</replaceable>])</emphasis>, <emphasis>sock:writable([<replaceable>timeout</replaceable>])</emphasis>, <emphasis>sock:wait([<replaceable>timeout</replaceable>])</emphasis></term> <listitem> <para> <code>sock:readable()</code> waits until something is readable, or until a timeout value expires. @@ -2432,7 +2438,7 @@ end one Tarantool server to start listening on an administrative host/port. </para> - + <variablelist> @@ -2529,6 +2535,61 @@ end +</section> + + +<section xml:id="sp-log"> + <title>package <code>log</code></title> + <para> + The Tarantool server puts all diagnostic messages in a log file + specified by the <link linkend="logger">logger</link> + configuration parameter. Diagnostic messages may be either + system-generated by the server's internal code, or user-generated + with the <code>log.<replaceable>log_level_function_name</replaceable></code> function. + </para> +<variablelist> + <varlistentry> + <term><emphasis role="lua">log.<replaceable>log_level_function_name</replaceable>(<replaceable>log_message</replaceable>)</emphasis></term> + <listitem> + <para> + Output a user-generated message to the <link linkend="logger">log file</link>, given + log_level_function_name = <code>error</code> or <code>warn</code> or <code>info</code> + or <code>debug</code> or <code>rotate</code>. + </para> + <para> + Returns: nothing. + </para> + <para> + Parameters: (type = string) log_message. The actual output will be a + line containing the current timestamp, a module name, 'E' or 'W' or 'I' or 'D' or 'R' depending on + log_level_function_name, and log_message. Output will not occur if log_level_function_name is for a type greater than + <link linkend="log_level">log_level</link>. + </para> + <para> + <bridgehead renderas="sect4">Example showing use of log</bridgehead><programlisting> +#From the shell: +#Start the server, do some requests, exit, and display the log, thus: +~/tarantool/src/tarantool +box.cfg{log_level=3, logger='tarantool.txt'} +log = require('log') +log.error('Error') +log.info('Info') +os.exit() +less tarantool.txt +</programlisting> + The output from the <code>less</code> command will look approximately like this: +<programlisting> +2014-09-21 17:58:40.820 [5257] main/101/interactive C> version 1.6.3-355-ga4f762d +2014-09-21 17:58:40.821 [5257] main/101/interactive C> log level 3 +2014-09-21 17:58:40.821 [5261] main/101/spawner C> initialized +2014-09-21 17:58:40.830 [5257] main/101/interactive [C]:-1 E> Error +</programlisting> + The 'Error' line is visible in tarantool.txt preceded by the letter E. + The 'Info' line is not present because the log_level is 3. + </para> + </listitem> + </varlistentry> + </variablelist> </section> <section xml:id="sp-tonumber64"> diff --git a/doc/user/tutorial.xml b/doc/user/tutorial.xml index 7379892b901524a450c1119f6b68edb753f277f3..c11b52f6ba3b147f2cf2c5c5f4d479015d1bc87f 100644 --- a/doc/user/tutorial.xml +++ b/doc/user/tutorial.xml @@ -350,16 +350,7 @@ ones unless you intend to work on the documentation.</para> <command>cd</command> python-daemon-1.5.5 <command>sudo python</command> setup.py install </userinput> -# python module for template engine (jinja2): For documentation: -# (If wget fails, check the <citetitle xlink:href="https://pypi.python.org/pypi/Jinja2" xlink:title="Python Jinja2">python-jinja2</citetitle> web site -# to see what the current version is.) -<userinput> -<command>cd</command> ~ -<command>wget</command> https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.2.tar.gz -<command>tar</command> <option>-xzvf</option> Jinja2-2.7.2.tar.gz -<command>cd</command> Jinja2-2.7.2 -<command>sudo python</command> setup.py install -</userinput> + # python module for text-to-html conversion (markdown): For documentation: # (If wget fails, check the <citetitle xlink:href="http://pypi.python.org/pypi/Markdown/" xlink:title="Python implementation of Markdown">python-markdown</citetitle> web site # to see what the current version is.) @@ -370,6 +361,19 @@ ones unless you intend to work on the documentation.</para> <command>cd</command> Markdown-2.3.1 <command>sudo python</command> setup.py install </userinput> +# python module which includes Jinja2 template engine: For documentation: +<userinput> +<command>sudo pip install pelican</command> +</userinput> +# python module for HTML scraping: For documentation: +<userinput> +<command>cd</command> ~ +<command>wget</command> http://www.crummy.com/software/BeautifulSoup/bs3/download//3.x/BeautifulSoup-3.2.1.tar.gz +<command>tar</command> -xzvf BeautifulSoup-3.2.1.tar.gz +<command>cd</command> BeautifulSoup-3.2.1 +<command>sudo python</command> setup.py install +</userinput> + </programlisting> </para>