webgui/www/extras/yui/docs/logger/overview-summary-LogWriter.js.html
JT Smith 4f68a0933c added YUI and YUI-ext
fixed the resizable text area with IE problem
fixed the ad space with IE problem
merged the 7.2.0 and 7.1.4 change logs
2006-11-07 23:15:57 +00:00

268 lines
6.7 KiB
HTML

<html>
<head>
<title>JavaScript Documentation - LogWriter.js</title>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<h1>JavaScript Documentation</h1>
<h3><a href="./index.html">Logger</a></h3>
<div class="breadcrumbs">
<a href="./index.html">Logger</a>
&gt;
<strong>LogWriter.js</strong>
</div>
</div>
<div id="body">
<div class="nav">
<div class="module resources">
<ul class="content">
<li><a href="overview-tree.html">Tree View</a></li>
<li><a href="index-all.html">Element Index</a></li>
</ul>
</div>
<div class="module">
<h4><a href="./allclasses-noframe.html">Classes</a></h4>
<ul class="content">
<li>
<a href="YAHOO.widget.html">
YAHOO.widget</a>
</li>
<li>
<a href="YAHOO.widget.LogReader.html">
YAHOO.widget.LogReader</a>
</li>
<li>
<a href="YAHOO.widget.LogWriter.html">
YAHOO.widget.LogWriter</a>
</li>
</ul>
</div>
<div class="module">
<h4><a href="./overview-summary.html">Files</a></h4>
<ul class="content">
<li>
<a href="overview-summary-Logger.js.html">
Logger.js</a>
</li>
<li>
<a href="overview-summary-LogReader.js.html">
LogReader.js</a>
</li>
<li>
<a href="overview-summary-LogWriter.js.html">
LogWriter.js</a>
</li>
</ul>
</div>
</div>
<div class="main">
<h2>LogWriter.js</h2>
<div class="meta">
</div>
<div class="quick-links">
<strong>Quick Links:</strong>&nbsp;
<a href="#classSummary">Class Summary</a> |
<a href="#source">Source Code</a>
</div>
<div class="section class summaries">
<h3><a name="classSummary">Class Summary</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<td class="name">
<a href="YAHOO.widget.LogWriter.html">YAHOO.widget.LogWriter</a>
</td>
<td class="overview">&nbsp;</td>
</tr>
</table>
</div>
</div>
<div class="section source">
<h3><a name="source">Souce Code</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<pre class="sourceview"><span class="comment">/****************************************************************************/</span>
<span class="comment">/****************************************************************************/</span>
<span class="comment">/****************************************************************************/</span>
<span class="comment">/**
* Class providing ability to log messages through YAHOO.widget.Logger from a
* named source.
*
* <span class="attrib">@constructor</span>
* <span class="attrib">@param</span> {string} sSource Source of LogWriter instance
*/</span>
YAHOO.widget.LogWriter = <span class="reserved">function</span>(sSource) {
<span class="reserved">if</span>(!sSource) {
YAHOO.log(<span class="literal">"Could not instantiate LogWriter due to invalid source."</span>, <span class="literal">"error"</span>, <span class="literal">"LogWriter"</span>);
<span class="reserved">return</span>;
}
<span class="reserved">this</span>._source = sSource;
};
<span class="comment">/***************************************************************************
* Public methods
***************************************************************************/</span>
<span class="comment">/**
* Public accessor to the unique name of the LogWriter instance.
*
* <span class="attrib">@return</span> {string} Unique name of the LogWriter instance
*/</span>
YAHOO.widget.LogWriter.<span class="reserved">prototype</span>.toString = <span class="reserved">function</span>() {
<span class="reserved">return</span> <span class="literal">"LogWriter "</span> + <span class="reserved">this</span>._sSource;
};
<span class="comment">/**
* Logs a message attached to the source of the LogWriter.
*
* <span class="attrib">@param</span> {string} sMsg The log message
* <span class="attrib">@param</span> {string} sCategory Category name
*/</span>
YAHOO.widget.LogWriter.<span class="reserved">prototype</span>.log = <span class="reserved">function</span>(sMsg, sCategory) {
YAHOO.widget.Logger.log(sMsg, sCategory, <span class="reserved">this</span>._source);
};
<span class="comment">/**
* Public accessor to get the source name.
*
* <span class="attrib">@return</span> {string} The LogWriter source
*/</span>
YAHOO.widget.LogWriter.<span class="reserved">prototype</span>.getSource = <span class="reserved">function</span>() {
<span class="reserved">return</span> <span class="reserved">this</span>._sSource;
};
<span class="comment">/**
* Public accessor to set the source name.
*
* <span class="attrib">@param</span> {string} sSource Source of LogWriter instance
*/</span>
YAHOO.widget.LogWriter.<span class="reserved">prototype</span>.setSource = <span class="reserved">function</span>(sSource) {
<span class="reserved">if</span>(!sSource) {
YAHOO.log(<span class="literal">"Could not set source due to invalid source."</span>, <span class="literal">"error"</span>, <span class="reserved">this</span>.toString());
<span class="reserved">return</span>;
}
<span class="reserved">else</span> {
<span class="reserved">this</span>._sSource = sSource;
}
};
<span class="comment">/***************************************************************************
* Private members
***************************************************************************/</span>
<span class="comment">/**
* Source of the log writer instance.
*
* <span class="attrib">@type</span> string
* <span class="attrib">@private</span>
*/</span>
YAHOO.widget.LogWriter.<span class="reserved">prototype</span>._source = null;
</pre>
</div>
</div>
</div>
<div id="footer">
<hr />
Copyright &copy; 2006 Yahoo! Inc. All rights reserved.
<br />
Documentation generated by <a href="http://jsdoc.sourceforge.net/">JSDoc</a>
</div>
</body>
</html>