nodulator
Version:
Complete NodeJS Framework for Restfull APIs
312 lines (200 loc) • 9.85 kB
HTML
<html>
<head>
<title>Debug.ls</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
<div id="container">
<div id="background"></div>
<ul id="jump_to">
<li>
<a class="large" href="javascript:void(0);">Jump To …</a>
<a class="small" href="javascript:void(0);">+</a>
<div id="jump_wrapper">
<div id="jump_page_wrapper">
<div id="jump_page">
<a class="source" href="Nodulator.html">
Nodulator.ls
</a>
<a class="source" href="ClientDB.html">
ClientDB.ls
</a>
<a class="source" href="index.html">
index.ls
</a>
<a class="source" href="Resource.html">
Resource.ls
</a>
<a class="source" href="Bus.html">
Bus.ls
</a>
<a class="source" href="Cache.html">
Cache.ls
</a>
<a class="source" href="ChangeWatcher.html">
ChangeWatcher.ls
</a>
<a class="source" href="Debug.html">
Debug.ls
</a>
<a class="source" href="Wrappers.html">
Wrappers.ls
</a>
<a class="source" href="Nodulator.html">
Nodulator.ls
</a>
<a class="source" href="Resource.html">
Resource.ls
</a>
<a class="source" href="Schema.html">
Schema.ls
</a>
<a class="source" href="NModule.html">
NModule.ls
</a>
<a class="source" href="AccountResource.html">
AccountResource.ls
</a>
<a class="source" href="User.html">
User.ls
</a>
<a class="source" href="index.html">
index.ls
</a>
<a class="source" href="Nodulator-Angular.html">
Nodulator-Angular.ls
</a>
<a class="source" href="TaskDirective.html">
TaskDirective.ls
</a>
<a class="source" href="index.html">
index.ls
</a>
<a class="source" href="TaskService.html">
TaskService.ls
</a>
<a class="source" href="main.html">
main.ls
</a>
<a class="source" href="index.html">
index.ls
</a>
<a class="source" href="index.html">
index.ls
</a>
<a class="source" href="Task.html">
Task.ls
</a>
<a class="source" href="index.html">
index.ls
</a>
<a class="source" href="index.html">
index.ls
</a>
<a class="source" href="index.html">
index.ls
</a>
<a class="source" href="index.html">
index.ls
</a>
<a class="source" href="index.html">
index.ls
</a>
<a class="source" href="DOM.html">
DOM.ls
</a>
<a class="source" href="View.html">
View.ls
</a>
<a class="source" href="index.html">
index.ls
</a>
<a class="source" href="Nodulator.html">
Nodulator.ls
</a>
<a class="source" href="Mongo.html">
Mongo.ls
</a>
<a class="source" href="Mysql.html">
Mysql.ls
</a>
<a class="source" href="SqlMem.html">
SqlMem.ls
</a>
<a class="source" href="index.html">
index.ls
</a>
<a class="source" href="Resource.html">
Resource.ls
</a>
<a class="source" href="Request.html">
Request.ls
</a>
<a class="source" href="Route.html">
Route.ls
</a>
<a class="source" href="index.html">
index.ls
</a>
</div>
</div>
</li>
</ul>
<ul class="sections">
<li id="title">
<div class="annotation">
<h1>Debug.ls</h1>
</div>
</li>
<li id="section-1">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-1">¶</a>
</div>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">require</span>! debug
debug.depth = <span class="hljs-number">0</span>
debug.longuest = <span class="hljs-number">0</span>
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Debug</span></span>
@depthActivated = <span class="hljs-literal">false</span>
depthStr: <span class="hljs-string">''</span>
@colors =
cyan: debug.colors[<span class="hljs-number">0</span>]
green: debug.colors[<span class="hljs-number">1</span>]
yellow: debug.colors[<span class="hljs-number">2</span>]
blue: debug.colors[<span class="hljs-number">3</span>]
purple: debug.colors[<span class="hljs-number">4</span>]
red: debug.colors[<span class="hljs-number">5</span>]
(it, color = debug.colors[<span class="hljs-number">1</span>], objDebug = <span class="hljs-literal">false</span>) ->
@name = it
debug.longuest = max debug.longuest, it.length + <span class="hljs-number">7</span>
@_out = debug it + <span class="hljs-string">'::Log'</span>
..color = debug.useColors && color
@_outWarn = debug it + <span class="hljs-string">'::Warn'</span>
..color = debug.useColors && @@colors.yellow
@_outError = debug it + <span class="hljs-string">'::Error'</span>
..color = debug.useColors && @@colors.red
_DepthStr: <span class="hljs-function">-></span> [<span class="hljs-string">'.'</span> <span class="hljs-keyword">for</span> i from <span class="hljs-number">0</span> til debug.depth]*<span class="hljs-string">''</span>
_Padding: <span class="hljs-function">-></span> [<span class="hljs-string">' '</span> <span class="hljs-keyword">for</span> i from <span class="hljs-number">0</span> til debug.longuest - @name.length - it]*<span class="hljs-string">''</span>
Log: <span class="hljs-function">-></span> @_out @_Padding(<span class="hljs-number">5</span>) + @_DepthStr! + it
Warn: <span class="hljs-function">-></span> @_outWarn @_Padding(<span class="hljs-number">6</span>) + @_DepthStr! + it
Error: <span class="hljs-function">-></span> @_outError @_Padding(<span class="hljs-number">7</span>) + @_DepthStr! + it
@Depth = <span class="hljs-function">-></span> debug.depth = debug.depth + <span class="hljs-number">1</span> <span class="hljs-keyword">if</span> @depthActivated
@UnDepth = <span class="hljs-function">-></span> debug.depth = debug.depth - <span class="hljs-number">1</span> <span class="hljs-keyword">if</span> @depthActivated
<span class="hljs-built_in">module</span>.exports = Debug</pre></div></div>
</li>
<li id="section-2">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-2">¶</a>
</div>
<p>Add debug for objects with utils.debug</p>
</div>
</li>
</ul>
</div>
</body>
</html>