Permalink
Browse files

v1.1.2. Minor.

- v1.1.2 August 10, 2012
	- Rejigged directory structure
	- Re-added markdown files to nom distribution as they are required for
the nom website
  • Loading branch information...
1 parent 3e9a328 commit 43964a5f5ebbba7e8718c9adcbcc0940bec2f551 @balupton balupton committed Aug 10, 2012
View
17 .gitignore
@@ -0,0 +1,17 @@
+lib-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+
+pids
+logs
+results
+
+node_modules
+npm-debug.log
+
+out/
View
4 .npmignore
@@ -1,8 +1,6 @@
-.DS_Store
-.git*
.travis*
-*.md
Makefile
+
docs/
example/
src/
View
4 History.md
@@ -1,5 +1,9 @@
## History
+- v1.1.2 August 10, 2012
+ - Rejigged directory structure
+ - Re-added markdown files to npm distribution as they are required for the npm website
+
- v1.1.1 May 4, 2012
- Fixed dependency overwrite
View
23 Makefile
@@ -1,22 +1,19 @@
+# If you change something here, be sure to change it in package.json's scripts as well
+
dev:
- ./node_modules/.bin/coffee -w -o lib/ -c src/
+ ./node_modules/.bin/coffee -w -o out/ -c src/
+
+compile:
+ ./node_modules/.bin/coffee -o out/ -c src/
-docs:
- ./node_modules/.bin/docco src/*.coffee
+clean:
+ rm -Rf lib node_modules/ npm-debug.log
+ npm install
example:
./node_modules/.bin/coffee ./example/console.coffee
example-debug:
./node_modules/.bin/coffee ./example/console.coffee -d
-clean:
- rm -Rf node_modules/ npm-debug.log
- npm install
-
-test:
- make clean
- make example
- make example-debug
-
-.PHONY: dev docs example example-debug clean test
+.PHONY: dev compile clean example example-debug
View
12 docs/caterpillar.html
@@ -1,12 +0,0 @@
-<!DOCTYPE html> <html> <head> <title>caterpillar.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="caterpillar.html"> caterpillar.coffee </a> <a class="source" href="formatter.html"> formatter.coffee </a> <a class="source" href="logger.html"> logger.coffee </a> <a class="source" href="transport.html"> transport.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> caterpillar.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Requires</p> </td> <td class="code"> <div class="highlight"><pre><span class="p">{</span><span class="nx">cliColor</span><span class="p">,</span><span class="nx">Formatter</span><span class="p">,</span><span class="nx">ConsoleFormatter</span><span class="p">}</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s2">&quot;#{__dirname}/formatter&quot;</span><span class="p">)</span>
-<span class="p">{</span><span class="nx">Logger</span><span class="p">}</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s2">&quot;#{__dirname}/logger&quot;</span><span class="p">)</span>
-<span class="p">{</span><span class="nx">Transport</span><span class="p">,</span><span class="nx">ConsoleTransport</span><span class="p">}</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s2">&quot;#{__dirname}/transport&quot;</span><span class="p">)</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Export</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">module.exports = </span><span class="p">{</span>
- <span class="nx">cliColor</span><span class="p">,</span>
- <span class="nx">Formatter</span><span class="p">,</span>
- <span class="nx">ConsoleFormatter</span><span class="p">,</span>
- <span class="nx">Logger</span><span class="p">,</span>
- <span class="nx">Transport</span><span class="p">,</span>
- <span class="nx">ConsoleTransport</span>
-<span class="p">}</span>
-
-</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
186 docs/docco.css
@@ -1,186 +0,0 @@
-/*--------------------- Layout and Typography ----------------------------*/
-body {
- font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
- font-size: 15px;
- line-height: 22px;
- color: #252519;
- margin: 0; padding: 0;
-}
-a {
- color: #261a3b;
-}
- a:visited {
- color: #261a3b;
- }
-p {
- margin: 0 0 15px 0;
-}
-h1, h2, h3, h4, h5, h6 {
- margin: 0px 0 15px 0;
-}
- h1 {
- margin-top: 40px;
- }
-#container {
- position: relative;
-}
-#background {
- position: fixed;
- top: 0; left: 525px; right: 0; bottom: 0;
- background: #f5f5ff;
- border-left: 1px solid #e5e5ee;
- z-index: -1;
-}
-#jump_to, #jump_page {
- background: white;
- -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;
- -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;
- font: 10px Arial;
- text-transform: uppercase;
- cursor: pointer;
- text-align: right;
-}
-#jump_to, #jump_wrapper {
- position: fixed;
- right: 0; top: 0;
- padding: 5px 10px;
-}
- #jump_wrapper {
- padding: 0;
- display: none;
- }
- #jump_to:hover #jump_wrapper {
- display: block;
- }
- #jump_page {
- padding: 5px 0 3px;
- margin: 0 0 25px 25px;
- }
- #jump_page .source {
- display: block;
- padding: 5px 10px;
- text-decoration: none;
- border-top: 1px solid #eee;
- }
- #jump_page .source:hover {
- background: #f5f5ff;
- }
- #jump_page .source:first-child {
- }
-table td {
- border: 0;
- outline: 0;
-}
- td.docs, th.docs {
- max-width: 450px;
- min-width: 450px;
- min-height: 5px;
- padding: 10px 25px 1px 50px;
- overflow-x: hidden;
- vertical-align: top;
- text-align: left;
- }
- .docs pre {
- margin: 15px 0 15px;
- padding-left: 15px;
- }
- .docs p tt, .docs p code {
- background: #f8f8ff;
- border: 1px solid #dedede;
- font-size: 12px;
- padding: 0 0.2em;
- }
- .pilwrap {
- position: relative;
- }
- .pilcrow {
- font: 12px Arial;
- text-decoration: none;
- color: #454545;
- position: absolute;
- top: 3px; left: -20px;
- padding: 1px 2px;
- opacity: 0;
- -webkit-transition: opacity 0.2s linear;
- }
- td.docs:hover .pilcrow {
- opacity: 1;
- }
- td.code, th.code {
- padding: 14px 15px 16px 25px;
- width: 100%;
- vertical-align: top;
- background: #f5f5ff;
- border-left: 1px solid #e5e5ee;
- }
- pre, tt, code {
- font-size: 12px; line-height: 18px;
- font-family: Monaco, Consolas, "Lucida Console", monospace;
- margin: 0; padding: 0;
- }
-
-
-/*---------------------- Syntax Highlighting -----------------------------*/
-td.linenos { background-color: #f0f0f0; padding-right: 10px; }
-span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
-body .hll { background-color: #ffffcc }
-body .c { color: #408080; font-style: italic } /* Comment */
-body .err { border: 1px solid #FF0000 } /* Error */
-body .k { color: #954121 } /* Keyword */
-body .o { color: #666666 } /* Operator */
-body .cm { color: #408080; font-style: italic } /* Comment.Multiline */
-body .cp { color: #BC7A00 } /* Comment.Preproc */
-body .c1 { color: #408080; font-style: italic } /* Comment.Single */
-body .cs { color: #408080; font-style: italic } /* Comment.Special */
-body .gd { color: #A00000 } /* Generic.Deleted */
-body .ge { font-style: italic } /* Generic.Emph */
-body .gr { color: #FF0000 } /* Generic.Error */
-body .gh { color: #000080; font-weight: bold } /* Generic.Heading */
-body .gi { color: #00A000 } /* Generic.Inserted */
-body .go { color: #808080 } /* Generic.Output */
-body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
-body .gs { font-weight: bold } /* Generic.Strong */
-body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
-body .gt { color: #0040D0 } /* Generic.Traceback */
-body .kc { color: #954121 } /* Keyword.Constant */
-body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */
-body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */
-body .kp { color: #954121 } /* Keyword.Pseudo */
-body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */
-body .kt { color: #B00040 } /* Keyword.Type */
-body .m { color: #666666 } /* Literal.Number */
-body .s { color: #219161 } /* Literal.String */
-body .na { color: #7D9029 } /* Name.Attribute */
-body .nb { color: #954121 } /* Name.Builtin */
-body .nc { color: #0000FF; font-weight: bold } /* Name.Class */
-body .no { color: #880000 } /* Name.Constant */
-body .nd { color: #AA22FF } /* Name.Decorator */
-body .ni { color: #999999; font-weight: bold } /* Name.Entity */
-body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
-body .nf { color: #0000FF } /* Name.Function */
-body .nl { color: #A0A000 } /* Name.Label */
-body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
-body .nt { color: #954121; font-weight: bold } /* Name.Tag */
-body .nv { color: #19469D } /* Name.Variable */
-body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
-body .w { color: #bbbbbb } /* Text.Whitespace */
-body .mf { color: #666666 } /* Literal.Number.Float */
-body .mh { color: #666666 } /* Literal.Number.Hex */
-body .mi { color: #666666 } /* Literal.Number.Integer */
-body .mo { color: #666666 } /* Literal.Number.Oct */
-body .sb { color: #219161 } /* Literal.String.Backtick */
-body .sc { color: #219161 } /* Literal.String.Char */
-body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */
-body .s2 { color: #219161 } /* Literal.String.Double */
-body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
-body .sh { color: #219161 } /* Literal.String.Heredoc */
-body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
-body .sx { color: #954121 } /* Literal.String.Other */
-body .sr { color: #BB6688 } /* Literal.String.Regex */
-body .s1 { color: #219161 } /* Literal.String.Single */
-body .ss { color: #19469D } /* Literal.String.Symbol */
-body .bp { color: #954121 } /* Name.Builtin.Pseudo */
-body .vc { color: #19469D } /* Name.Variable.Class */
-body .vg { color: #19469D } /* Name.Variable.Global */
-body .vi { color: #19469D } /* Name.Variable.Instance */
-body .il { color: #666666 } /* Literal.Number.Integer.Long */
View
102 docs/formatter.html
@@ -1,102 +0,0 @@
-<!DOCTYPE html> <html> <head> <title>formatter.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="caterpillar.html"> caterpillar.coffee </a> <a class="source" href="formatter.html"> formatter.coffee </a> <a class="source" href="logger.html"> logger.coffee </a> <a class="source" href="transport.html"> transport.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> formatter.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Requires</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">util = </span><span class="nx">require</span><span class="p">(</span><span class="s1">&#39;util&#39;</span><span class="p">)</span>
-<span class="nv">cliColor = </span><span class="nx">require</span><span class="p">(</span><span class="s1">&#39;cli-color&#39;</span><span class="p">)</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Formatter</p> </td> <td class="code"> <div class="highlight"><pre><span class="k">class</span> <span class="nx">Formatter</span>
- <span class="nv">config:</span>
- <span class="nv">colors:</span>
- <span class="mi">0</span><span class="o">:</span> <span class="s1">&#39;red&#39;</span>
- <span class="mi">1</span><span class="o">:</span> <span class="s1">&#39;red&#39;</span>
- <span class="mi">2</span><span class="o">:</span> <span class="s1">&#39;red&#39;</span>
- <span class="mi">3</span><span class="o">:</span> <span class="s1">&#39;red&#39;</span>
- <span class="mi">4</span><span class="o">:</span> <span class="s1">&#39;yellow&#39;</span>
- <span class="mi">5</span><span class="o">:</span> <span class="s1">&#39;yellow&#39;</span>
- <span class="mi">6</span><span class="o">:</span> <span class="s1">&#39;green&#39;</span>
- <span class="mi">7</span><span class="o">:</span> <span class="s1">&#39;green&#39;</span>
- <span class="nv">level: </span><span class="mi">7</span>
-
- <span class="nv">constructor: </span><span class="nf">(config) -&gt;</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>Apply config</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">config</span> <span class="o">or=</span> <span class="p">{}</span>
- <span class="nx">config</span><span class="p">[</span><span class="nx">key</span><span class="p">]</span> <span class="o">?=</span> <span class="nx">value</span> <span class="k">for</span> <span class="nx">own</span> <span class="nx">key</span><span class="p">,</span><span class="nx">value</span> <span class="k">of</span> <span class="nx">@config</span>
- <span class="vi">@config = </span><span class="nx">config</span>
-
- <span class="nv">getLevel: </span><span class="o">-&gt;</span>
- <span class="nx">@config</span><span class="p">.</span><span class="nx">level</span> <span class="o">?</span> <span class="kc">null</span>
-
- <span class="nv">setLevel: </span><span class="nf">(level) -&gt;</span>
- <span class="vi">@config.level = </span><span class="nx">level</span>
- <span class="err">@</span>
-
- <span class="nv">padLeft: </span><span class="nf">(padding,size,msg) -&gt;</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Prepare</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">padding = </span><span class="nb">String</span><span class="p">(</span><span class="nx">padding</span><span class="p">)</span>
- <span class="nv">msg = </span><span class="nb">String</span><span class="p">(</span><span class="nx">msg</span><span class="p">)</span>
- </pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>Handle</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="nx">msg</span><span class="p">.</span><span class="nx">length</span> <span class="o">&lt;</span> <span class="nx">size</span>
- <span class="k">for</span> <span class="nx">i</span> <span class="k">in</span> <span class="p">[</span><span class="mi">0</span><span class="p">...</span><span class="nx">size</span><span class="o">-</span><span class="nx">msg</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span>
- <span class="nv">msg = </span><span class="nx">padding</span><span class="o">+</span><span class="nx">msg</span>
- </pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>Return</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">msg</span>
-
- <span class="nv">padRight: </span><span class="nf">(padding,size,msg) -&gt;</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <p>Prepare</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">padding = </span><span class="nb">String</span><span class="p">(</span><span class="nx">padding</span><span class="p">)</span>
- <span class="nv">msg = </span><span class="nb">String</span><span class="p">(</span><span class="nx">msg</span><span class="p">)</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>Handle</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="nx">msg</span><span class="p">.</span><span class="nx">length</span> <span class="o">&lt;</span> <span class="nx">size</span>
- <span class="k">for</span> <span class="nx">i</span> <span class="k">in</span> <span class="p">[</span><span class="mi">0</span><span class="p">...</span><span class="nx">size</span><span class="o">-</span><span class="nx">msg</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span>
- <span class="nx">msg</span> <span class="o">+=</span> <span class="nx">padding</span>
- </pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <p>Return</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">msg</span>
-
- <span class="nv">details: </span><span class="nf">(levelCode, levelName, args) -&gt;</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <p>Prepare</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">date = </span><span class="nx">@getDate</span><span class="p">()</span>
- <span class="p">{</span><span class="nx">file</span><span class="p">,</span><span class="nx">line</span><span class="p">,</span><span class="nx">method</span><span class="p">}</span> <span class="o">=</span> <span class="nx">@getLineInfo</span><span class="p">()</span>
- <span class="nv">color = </span><span class="nx">@getColor</span><span class="p">(</span><span class="nx">levelCode</span><span class="p">)</span></pre></div> </td> </tr> <tr id="section-11"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-11">&#182;</a> </div> <p>Handle</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">parts = </span><span class="p">[]</span>
- <span class="k">for</span> <span class="nx">value</span><span class="p">,</span> <span class="nx">index</span> <span class="k">in</span> <span class="nx">args</span>
- <span class="nx">parts</span><span class="p">[</span><span class="nx">index</span><span class="p">]</span> <span class="o">=</span>
- <span class="k">if</span> <span class="k">typeof</span> <span class="nx">value</span> <span class="o">is</span> <span class="s1">&#39;string&#39;</span>
- <span class="nx">value</span>
- <span class="k">else</span>
- <span class="nx">util</span><span class="p">.</span><span class="nx">inspect</span> <span class="nx">value</span><span class="p">,</span> <span class="kc">false</span><span class="p">,</span> <span class="mi">10</span>
- <span class="nv">message = </span><span class="nx">parts</span><span class="p">.</span><span class="nx">join</span> <span class="s1">&#39; &#39;</span></pre></div> </td> </tr> <tr id="section-12"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-12">&#182;</a> </div> <p>Return</p> </td> <td class="code"> <div class="highlight"><pre> <span class="p">{</span><span class="nx">date</span><span class="p">,</span><span class="nx">file</span><span class="p">,</span><span class="nx">line</span><span class="p">,</span><span class="nx">method</span><span class="p">,</span><span class="nx">color</span><span class="p">,</span><span class="nx">levelName</span><span class="p">,</span><span class="nx">message</span><span class="p">}</span>
-
- <span class="nv">format: </span><span class="nf">(levelCode,levelName,args) -&gt;</span></pre></div> </td> </tr> <tr id="section-13"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-13">&#182;</a> </div> <p>Prepare</p> </td> <td class="code"> <div class="highlight"><pre> <span class="p">{</span><span class="nx">date</span><span class="p">,</span><span class="nx">className</span><span class="p">,</span><span class="nx">line</span><span class="p">,</span><span class="nx">levelName</span><span class="p">,</span><span class="nx">message</span><span class="p">}</span> <span class="o">=</span> <span class="nx">@details</span> <span class="nx">levelCode</span><span class="p">,</span> <span class="nx">levelName</span><span class="p">,</span> <span class="nx">args</span></pre></div> </td> </tr> <tr id="section-14"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-14">&#182;</a> </div> <p>Return</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="nx">@config</span><span class="p">.</span><span class="nx">level</span> <span class="o">is</span> <span class="mi">7</span></pre></div> </td> </tr> <tr id="section-15"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-15">&#182;</a> </div> <p>Debug</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">message = </span><span class="s2">&quot;[#{date}] [#{className}: #{line}] &quot;</span><span class="o">+</span><span class="nx">@padLeft</span><span class="p">(</span><span class="s1">&#39; &#39;</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="s2">&quot;#{levelName}:&quot;</span><span class="p">)</span><span class="o">+</span><span class="s2">&quot; #{message}&quot;</span>
- <span class="k">else</span></pre></div> </td> </tr> <tr id="section-16"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-16">&#182;</a> </div> <p>Normal</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">message = </span><span class="nx">@padLeft</span><span class="p">(</span><span class="s1">&#39; &#39;</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="s2">&quot;#{levelName}:&quot;</span><span class="p">)</span><span class="o">+</span><span class="s2">&quot; #{message}&quot;</span>
-
- <span class="nv">getColor: </span><span class="nf">(levelCode) -&gt;</span></pre></div> </td> </tr> <tr id="section-17"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-17">&#182;</a> </div> <p>Return</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">color =</span>
- <span class="k">if</span> <span class="nx">@config</span><span class="p">.</span><span class="nx">colors</span>
- <span class="nx">@config</span><span class="p">.</span><span class="nx">colors</span><span class="p">[</span><span class="nx">levelCode</span><span class="p">]</span>
- <span class="k">else</span>
- <span class="kc">false</span>
-
- <span class="nv">getDate: </span><span class="o">-&gt;</span></pre></div> </td> </tr> <tr id="section-18"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-18">&#182;</a> </div> <p>Prepare</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">now = </span><span class="k">new</span> <span class="nb">Date</span><span class="p">()</span>
- <span class="nv">year = </span><span class="nx">now</span><span class="p">.</span><span class="nx">getFullYear</span><span class="p">()</span>
- <span class="nv">month = </span><span class="nx">@padLeft</span> <span class="s1">&#39;0&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="nx">now</span><span class="p">.</span><span class="nx">getMonth</span><span class="p">()</span> <span class="o">+</span> <span class="mi">1</span>
- <span class="nv">date = </span><span class="nx">@padLeft</span> <span class="s1">&#39;0&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="nx">now</span><span class="p">.</span><span class="nx">getDate</span><span class="p">()</span>
- <span class="nv">hours = </span><span class="nx">@padLeft</span> <span class="s1">&#39;0&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="nx">now</span><span class="p">.</span><span class="nx">getHours</span><span class="p">()</span>
- <span class="nv">minutes = </span><span class="nx">@padLeft</span> <span class="s1">&#39;0&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="nx">now</span><span class="p">.</span><span class="nx">getMinutes</span><span class="p">()</span>
- <span class="nv">seconds = </span><span class="nx">@padLeft</span> <span class="s1">&#39;0&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="nx">now</span><span class="p">.</span><span class="nx">getSeconds</span><span class="p">()</span>
- <span class="nv">ms = </span><span class="nx">@padLeft</span> <span class="s1">&#39;0&#39;</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="nx">now</span><span class="p">.</span><span class="nx">getMilliseconds</span><span class="p">()</span></pre></div> </td> </tr> <tr id="section-19"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-19">&#182;</a> </div> <p>Return</p> </td> <td class="code"> <div class="highlight"><pre> <span class="s2">&quot;#{year}-#{month}-#{date} #{hours}:#{minutes}:#{seconds}.#{ms}&quot;</span>
-
- <span class="nv">getLineInfo: </span><span class="o">-&gt;</span></pre></div> </td> </tr> <tr id="section-20"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-20">&#182;</a> </div> <p>Prepare</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">result =</span>
- <span class="nv">line: </span><span class="o">-</span><span class="mi">1</span>
- <span class="nv">method: </span><span class="s1">&#39;unknown&#39;</span></pre></div> </td> </tr> <tr id="section-21"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-21">&#182;</a> </div> <p>Retrieve</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">try</span>
- <span class="k">throw</span> <span class="k">new</span> <span class="nb">Error</span><span class="p">()</span>
- <span class="k">catch</span> <span class="nx">e</span>
- <span class="nv">lines = </span><span class="nx">e</span><span class="p">.</span><span class="nx">stack</span><span class="p">.</span><span class="nx">split</span><span class="p">(</span><span class="s1">&#39;\n&#39;</span><span class="p">)</span>
- <span class="k">for</span> <span class="nx">line</span> <span class="k">in</span> <span class="nx">lines</span>
- <span class="k">continue</span> <span class="k">if</span> <span class="nx">line</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">__dirname</span><span class="p">)</span> <span class="o">isnt</span> <span class="o">-</span><span class="mi">1</span> <span class="o">or</span> <span class="nx">line</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39; at &#39;</span><span class="p">)</span> <span class="o">is</span> <span class="o">-</span><span class="mi">1</span>
- <span class="nv">parts = </span><span class="nx">line</span><span class="p">.</span><span class="nx">split</span><span class="p">(</span><span class="s1">&#39;:&#39;</span><span class="p">)</span>
- <span class="k">if</span> <span class="nx">parts</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;(&#39;</span><span class="p">)</span> <span class="o">is</span> <span class="o">-</span><span class="mi">1</span>
- <span class="nv">result.method = </span><span class="s1">&#39;unknown&#39;</span>
- <span class="nv">result.file = </span><span class="nx">parts</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/^.+?\s+at\s+/</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">)</span>
- <span class="k">else</span>
- <span class="nv">result.method = </span><span class="nx">parts</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/^.+?\s+at\s+/</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">).</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\s+\(.+$/</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">)</span>
- <span class="nv">result.file = </span><span class="nx">parts</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/^.+?\(/</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">)</span>
- <span class="nv">result.line = </span><span class="nx">parts</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
- <span class="k">break</span>
-
- <span class="k">return</span> <span class="nx">result</span></pre></div> </td> </tr> <tr id="section-22"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-22">&#182;</a> </div> <p>Console Formatter</p> </td> <td class="code"> <div class="highlight"><pre><span class="k">class</span> <span class="nx">ConsoleFormatter</span> <span class="k">extends</span> <span class="nx">Formatter</span>
- <span class="nv">format: </span><span class="nf">(levelCode,levelName,args) -&gt;</span></pre></div> </td> </tr> <tr id="section-23"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-23">&#182;</a> </div> <p>Prepare</p> </td> <td class="code"> <div class="highlight"><pre> <span class="p">{</span><span class="nx">date</span><span class="p">,</span><span class="nx">file</span><span class="p">,</span><span class="nx">line</span><span class="p">,</span><span class="nx">method</span><span class="p">,</span><span class="nx">color</span><span class="p">,</span><span class="nx">levelName</span><span class="p">,</span><span class="nx">message</span><span class="p">}</span> <span class="o">=</span> <span class="nx">@details</span><span class="p">(</span><span class="nx">levelCode</span><span class="p">,</span> <span class="nx">levelName</span><span class="p">,</span> <span class="nx">args</span><span class="p">)</span>
- </pre></div> </td> </tr> <tr id="section-24"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-24">&#182;</a> </div> <p>Check</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="o">!</span><span class="nx">message</span>
- <span class="nx">message</span>
- <span class="k">else</span></pre></div> </td> </tr> <tr id="section-25"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-25">&#182;</a> </div> <p>Mappings</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">color = </span><span class="nx">color</span> <span class="o">and</span> <span class="nx">cliColor</span><span class="p">[</span><span class="nx">color</span><span class="p">]</span> <span class="o">or</span> <span class="nf">(str) -&gt;</span> <span class="nx">str</span>
- <span class="nv">levelName = </span><span class="nx">color</span><span class="p">(</span><span class="nx">levelName</span><span class="o">+</span><span class="s1">&#39;:&#39;</span><span class="p">)</span></pre></div> </td> </tr> <tr id="section-26"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-26">&#182;</a> </div> <p>Formatters</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">debugFormatter = </span><span class="kc">false</span> <span class="c1">#cliColor.white</span>
- <span class="nv">messageFormatter = </span><span class="nx">cliColor</span><span class="p">.</span><span class="nx">bold</span></pre></div> </td> </tr> <tr id="section-27"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-27">&#182;</a> </div> <p>Message</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">messageString = </span><span class="s2">&quot;#{levelName} #{message}&quot;</span>
- <span class="nv">messageString = </span><span class="nx">messageFormatter</span><span class="p">(</span><span class="nx">messageString</span><span class="p">)</span> <span class="k">if</span> <span class="nx">messageFormatter</span></pre></div> </td> </tr> <tr id="section-28"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-28">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="nx">@config</span><span class="p">.</span><span class="nx">level</span> <span class="o">is</span> <span class="mi">7</span></pre></div> </td> </tr> <tr id="section-29"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-29">&#182;</a> </div> <p>Debug Information</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">seperator = </span><span class="s1">&#39;\n → &#39;</span>
- <span class="nv">debugString = </span><span class="s2">&quot;[#{date}] [#{file}:#{line}] [#{method}]&quot;</span>
- <span class="nv">debugString = </span><span class="nx">lineFormatter</span><span class="p">(</span><span class="nx">debugString</span><span class="p">)</span> <span class="k">if</span> <span class="nx">debugFormatter</span></pre></div> </td> </tr> <tr id="section-30"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-30">&#182;</a> </div> <p>Result</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">message = </span><span class="s2">&quot;#{messageString}#{seperator}#{debugString}&quot;</span>
- <span class="k">else</span></pre></div> </td> </tr> <tr id="section-31"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-31">&#182;</a> </div> <p>Result</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">message = </span><span class="nx">messageString</span></pre></div> </td> </tr> <tr id="section-32"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-32">&#182;</a> </div> <p>Export</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">module.exports = </span><span class="p">{</span>
- <span class="nx">cliColor</span><span class="p">,</span>
- <span class="nx">Formatter</span><span class="p">,</span>
- <span class="nx">ConsoleFormatter</span>
-<span class="p">}</span>
-
-</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
79 docs/logger.html
@@ -1,79 +0,0 @@
-<!DOCTYPE html> <html> <head> <title>logger.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="caterpillar.html"> caterpillar.coffee </a> <a class="source" href="formatter.html"> formatter.coffee </a> <a class="source" href="logger.html"> logger.coffee </a> <a class="source" href="transport.html"> transport.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> logger.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Requires</p> </td> <td class="code"> <div class="highlight"><pre><span class="p">{</span><span class="nx">Transport</span><span class="p">,</span><span class="nx">ConsoleTransport</span><span class="p">}</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s2">&quot;#{__dirname}/transport&quot;</span><span class="p">)</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Logger</p> </td> <td class="code"> <div class="highlight"><pre><span class="k">class</span> <span class="nx">Logger</span>
- <span class="nv">config:</span>
- <span class="nv">autoFlush: </span><span class="kc">true</span> <span class="c1"># (true or false) whether or not to auto flush after each message</span>
- <span class="nv">transports: </span><span class="kc">null</span> <span class="c1"># (Transport, object, array or false)</span>
- <span class="nv">level: </span><span class="mi">7</span>
- <span class="nv">levels:</span>
- <span class="nv">emergency: </span><span class="mi">0</span>
- <span class="nv">alert: </span><span class="mi">1</span>
- <span class="nv">critical: </span><span class="mi">2</span>
- <span class="nv">error: </span><span class="mi">3</span>
- <span class="nv">warning: </span><span class="mi">4</span>
- <span class="nv">notice: </span><span class="mi">5</span>
- <span class="nv">info: </span><span class="mi">6</span>
- <span class="nv">debug: </span><span class="mi">7</span>
-
- <span class="nv">emerg: </span><span class="mi">0</span>
- <span class="nv">crit: </span><span class="mi">2</span>
- <span class="nv">err: </span><span class="mi">3</span>
- <span class="nv">warn: </span><span class="mi">4</span>
- <span class="nv">note: </span><span class="mi">5</span>
-
- <span class="nv">default: </span><span class="mi">6</span>
-
- <span class="nv">messages: </span><span class="p">[]</span>
- <span class="nv">formatter: </span><span class="kc">null</span>
- <span class="nv">transports: </span><span class="p">[]</span>
-
- <span class="nv">constructor: </span><span class="nf">(config) -&gt;</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>Prepare</p> </td> <td class="code"> <div class="highlight"><pre> <span class="vi">@messages = </span><span class="p">[]</span>
- <span class="vi">@transports = </span><span class="p">[]</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Apply config</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">config</span> <span class="o">or=</span> <span class="p">{}</span>
- <span class="nx">config</span><span class="p">[</span><span class="nx">key</span><span class="p">]</span> <span class="o">?=</span> <span class="nx">value</span> <span class="k">for</span> <span class="nx">own</span> <span class="nx">key</span><span class="p">,</span><span class="nx">value</span> <span class="k">of</span> <span class="nx">@config</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>Apply levels</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">levels = </span><span class="p">{}</span>
- <span class="nx">levels</span><span class="p">[</span><span class="nx">key</span><span class="p">]</span> <span class="o">?=</span> <span class="nx">value</span> <span class="k">for</span> <span class="nx">own</span> <span class="nx">key</span><span class="p">,</span><span class="nx">value</span> <span class="k">of</span> <span class="nx">config</span><span class="p">.</span><span class="nx">levels</span>
- <span class="nv">config.levels = </span><span class="nx">levels</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>Apply transports</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">unless</span> <span class="nx">config</span><span class="p">.</span><span class="nx">transports</span>
- <span class="nv">config.transports = </span><span class="k">new</span> <span class="nx">ConsoleTransport</span>
- <span class="nx">unless</span> <span class="nx">config</span><span class="p">.</span><span class="nx">transports</span> <span class="k">instanceof</span> <span class="nb">Array</span>
- <span class="nv">config.transports = </span><span class="p">[</span><span class="nx">config</span><span class="p">.</span><span class="nx">transports</span><span class="p">]</span>
- <span class="k">for</span> <span class="nx">transport</span> <span class="k">in</span> <span class="nx">config</span><span class="p">.</span><span class="nx">transports</span>
- <span class="k">if</span> <span class="nx">transport</span> <span class="k">instanceof</span> <span class="nx">Transport</span>
- <span class="nx">@transports</span><span class="p">.</span><span class="nx">push</span> <span class="nx">transport</span>
- <span class="k">else</span> <span class="k">if</span> <span class="nx">transport</span>
- <span class="nx">@transports</span><span class="p">.</span><span class="nx">push</span> <span class="k">new</span> <span class="nx">ConsoleTransport</span> <span class="nx">transport</span>
- <span class="k">delete</span> <span class="nx">config</span><span class="p">.</span><span class="nx">transports</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <p>Level</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">@setLevel</span><span class="p">(</span><span class="nx">config</span><span class="p">.</span><span class="nx">level</span><span class="p">)</span> <span class="k">if</span> <span class="nx">config</span><span class="p">.</span><span class="nx">level</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>Apply config</p> </td> <td class="code"> <div class="highlight"><pre> <span class="vi">@config = </span><span class="nx">config</span>
-
- <span class="nv">getLevel: </span><span class="o">-&gt;</span>
- <span class="nx">@config</span><span class="p">.</span><span class="nx">level</span> <span class="o">?</span> <span class="kc">null</span>
-
- <span class="nv">setLevel: </span><span class="nf">(level) -&gt;</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <p>Apply</p> </td> <td class="code"> <div class="highlight"><pre> <span class="vi">@config.level = </span><span class="nx">level</span>
- <span class="k">for</span> <span class="nx">transport</span> <span class="k">in</span> <span class="nx">@transports</span>
- <span class="nx">transport</span><span class="p">.</span><span class="nx">setLevel</span><span class="p">(</span><span class="nx">level</span><span class="p">)</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <p>Chain</p> </td> <td class="code"> <div class="highlight"><pre> <span class="err">@</span>
-
- <span class="nv">getLevelCode: </span><span class="nf">(name) -&gt;</span></pre></div> </td> </tr> <tr id="section-11"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-11">&#182;</a> </div> <p>Return</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">@config</span><span class="p">.</span><span class="nx">levels</span><span class="p">[</span><span class="nx">name</span><span class="p">]</span> <span class="o">?</span> <span class="kc">null</span>
-
- <span class="nv">getLevelName: </span><span class="nf">(code) -&gt;</span></pre></div> </td> </tr> <tr id="section-12"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-12">&#182;</a> </div> <p>Try to treturn the levelName</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">for</span> <span class="nx">own</span> <span class="nx">key</span><span class="p">,</span><span class="nx">value</span> <span class="k">of</span> <span class="nx">@config</span><span class="p">.</span><span class="nx">levels</span>
- <span class="k">if</span> <span class="nx">value</span> <span class="o">is</span> <span class="nx">code</span>
- <span class="k">return</span> <span class="nx">key</span></pre></div> </td> </tr> <tr id="section-13"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-13">&#182;</a> </div> <p>else return</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kc">null</span>
-
- <span class="nv">log: </span><span class="nf">(level, args...) -&gt;</span></pre></div> </td> </tr> <tr id="section-14"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-14">&#182;</a> </div> <p>Log the entry</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="k">typeof</span> <span class="nx">level</span> <span class="o">is</span> <span class="s1">&#39;number&#39;</span>
- <span class="nv">levelCode = </span><span class="nx">level</span>
- <span class="nv">levelName = </span><span class="nx">@getLevelName</span> <span class="nx">levelCode</span>
- <span class="k">else</span>
- <span class="nv">levelName = </span><span class="nx">level</span>
- <span class="nv">levelCode = </span><span class="nx">@getLevelCode</span> <span class="nx">levelName</span>
- <span class="nv">levelName = </span><span class="nx">@getLevelName</span> <span class="nx">levelCode</span>
- <span class="nx">unless</span> <span class="nx">levelCode</span><span class="o">?</span>
- <span class="nv">levelCode = </span><span class="nx">@getLevelCode</span> <span class="s1">&#39;default&#39;</span>
- <span class="nv">levelName = </span><span class="nx">@getLevelName</span> <span class="nx">levelCode</span>
- <span class="nx">args</span><span class="p">.</span><span class="nx">unshift</span><span class="p">(</span><span class="nx">level</span><span class="p">)</span></pre></div> </td> </tr> <tr id="section-15"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-15">&#182;</a> </div> <p>Write the entry?</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="nx">@config</span><span class="p">.</span><span class="nx">autoFlush</span>
- <span class="nx">@write</span> <span class="nx">levelCode</span><span class="p">,</span><span class="nx">levelName</span><span class="p">,</span><span class="nx">args</span>
- <span class="k">else</span>
- <span class="nx">@messages</span><span class="p">.</span><span class="nx">push</span> <span class="p">{</span><span class="nx">levelCode</span><span class="p">,</span><span class="nx">levelName</span><span class="p">,</span><span class="nx">args</span><span class="p">}</span></pre></div> </td> </tr> <tr id="section-16"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-16">&#182;</a> </div> <p>Chain</p> </td> <td class="code"> <div class="highlight"><pre> <span class="err">@</span>
-
- <span class="nv">flush: </span><span class="o">-&gt;</span></pre></div> </td> </tr> <tr id="section-17"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-17">&#182;</a> </div> <p>Write messages</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">for</span> <span class="p">{</span><span class="nx">levelCode</span><span class="p">,</span><span class="nx">levelName</span><span class="p">,</span><span class="nx">args</span><span class="p">}</span> <span class="k">in</span> <span class="nx">@messages</span>
- <span class="nx">@write</span> <span class="nx">levelCode</span><span class="p">,</span><span class="nx">levelName</span><span class="p">,</span><span class="nx">args</span></pre></div> </td> </tr> <tr id="section-18"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-18">&#182;</a> </div> <p>Chain</p> </td> <td class="code"> <div class="highlight"><pre> <span class="err">@</span>
-
- <span class="nv">write: </span><span class="nf">(levelCode,levelName,args) -&gt;</span></pre></div> </td> </tr> <tr id="section-19"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-19">&#182;</a> </div> <p>Write the message</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">for</span> <span class="nx">transport</span> <span class="k">in</span> <span class="nx">@transports</span>
- <span class="nx">transport</span><span class="p">.</span><span class="nx">write</span> <span class="nx">levelCode</span><span class="p">,</span><span class="nx">levelName</span><span class="p">,</span><span class="nx">args</span></pre></div> </td> </tr> <tr id="section-20"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-20">&#182;</a> </div> <p>Chain</p> </td> <td class="code"> <div class="highlight"><pre> <span class="err">@</span></pre></div> </td> </tr> <tr id="section-21"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-21">&#182;</a> </div> <p>Export</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">module.exports = </span><span class="p">{</span>
- <span class="nx">Logger</span>
-<span class="p">}</span>
-
-</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
35 docs/transport.html
@@ -1,35 +0,0 @@
-<!DOCTYPE html> <html> <head> <title>transport.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="caterpillar.html"> caterpillar.coffee </a> <a class="source" href="formatter.html"> formatter.coffee </a> <a class="source" href="logger.html"> logger.coffee </a> <a class="source" href="transport.html"> transport.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> transport.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Requires</p> </td> <td class="code"> <div class="highlight"><pre><span class="p">{</span><span class="nx">Formatter</span><span class="p">,</span><span class="nx">ConsoleFormatter</span><span class="p">}</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s2">&quot;#{__dirname}/formatter&quot;</span><span class="p">)</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Transport</p> </td> <td class="code"> <div class="highlight"><pre><span class="k">class</span> <span class="nx">Transport</span>
- <span class="nv">config:</span>
- <span class="nv">level: </span><span class="mi">7</span>
- <span class="nv">formatter: </span><span class="kc">null</span> <span class="c1"># (Formatter, object or false)</span>
-
- <span class="nv">constructor: </span><span class="nf">(config) -&gt;</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>Apply config</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">config</span> <span class="o">or=</span> <span class="p">{}</span>
- <span class="nx">config</span><span class="p">[</span><span class="nx">key</span><span class="p">]</span> <span class="o">?=</span> <span class="nx">value</span> <span class="k">for</span> <span class="nx">own</span> <span class="nx">key</span><span class="p">,</span><span class="nx">value</span> <span class="k">of</span> <span class="nx">@config</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Apply formater</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="nx">config</span><span class="p">.</span><span class="nx">formatter</span> <span class="k">instanceof</span> <span class="nx">Formatter</span>
- <span class="vi">@formatter = </span><span class="nx">config</span><span class="p">.</span><span class="nx">formatter</span>
- <span class="k">else</span>
- <span class="vi">@formatter = </span><span class="k">new</span> <span class="nx">ConsoleFormatter</span> <span class="nx">config</span><span class="p">.</span><span class="nx">formatter</span>
- <span class="k">delete</span> <span class="nx">config</span><span class="p">.</span><span class="nx">formatter</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>Apply config</p> </td> <td class="code"> <div class="highlight"><pre> <span class="vi">@config = </span><span class="nx">config</span>
-
- <span class="nv">getLevel: </span><span class="o">-&gt;</span>
- <span class="nx">@config</span><span class="p">.</span><span class="nx">level</span> <span class="o">?</span> <span class="kc">null</span>
-
- <span class="nv">setLevel: </span><span class="nf">(level) -&gt;</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>Apply</p> </td> <td class="code"> <div class="highlight"><pre> <span class="vi">@config.level = </span><span class="nx">level</span>
- <span class="nx">@formatter</span><span class="p">.</span><span class="nx">setLevel</span><span class="p">(</span><span class="nx">level</span><span class="p">)</span> <span class="k">if</span> <span class="nx">@formatter</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <p>Chain</p> </td> <td class="code"> <div class="highlight"><pre> <span class="err">@</span>
-
- <span class="nv">care: </span><span class="nf">(levelCode) -&gt;</span>
- <span class="nx">levelCode</span> <span class="o">&lt;=</span> <span class="nx">@config</span><span class="p">.</span><span class="nx">level</span>
-
- <span class="nv">write: </span><span class="nf">(levelCode,levelName,message) -&gt;</span>
- <span class="k">if</span> <span class="nx">@care</span> <span class="nx">levelCode</span>
- <span class="nv">message = </span><span class="nx">@formatter</span><span class="p">.</span><span class="nx">format</span> <span class="nx">levelCode</span><span class="p">,</span><span class="nx">levelName</span><span class="p">,</span><span class="nx">message</span>
- <span class="k">else</span>
- <span class="kc">null</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>Console Transport</p> </td> <td class="code"> <div class="highlight"><pre><span class="k">class</span> <span class="nx">ConsoleTransport</span> <span class="k">extends</span> <span class="nx">Transport</span>
- <span class="nv">write: </span><span class="nf">(levelCode,levelName,message) -&gt;</span>
- <span class="nv">message = </span><span class="k">super</span> <span class="nx">levelCode</span><span class="p">,</span><span class="nx">levelName</span><span class="p">,</span><span class="nx">message</span>
- <span class="k">if</span> <span class="nx">message</span><span class="o">?</span>
- <span class="nx">console</span><span class="p">.</span><span class="nx">log</span> <span class="nx">message</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <p>Export</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">module.exports = </span><span class="p">{</span>
- <span class="nx">Transport</span><span class="p">,</span>
- <span class="nx">ConsoleTransport</span>
-<span class="p">}</span>
-
-</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
2 example/console.coffee
@@ -1,5 +1,5 @@
# Requires
-caterpillar = require "#{__dirname}/../lib/caterpillar"
+caterpillar = require "#{__dirname}/../out/lib/caterpillar"
# Create
logger = new caterpillar.Logger()
View
20 lib/caterpillar.js
@@ -1,20 +0,0 @@
-// Generated by CoffeeScript 1.3.1
-(function() {
- var ConsoleFormatter, ConsoleTransport, Formatter, Logger, Transport, cliColor, _ref, _ref1;
-
- _ref = require(__dirname + '/formatter'), cliColor = _ref.cliColor, Formatter = _ref.Formatter, ConsoleFormatter = _ref.ConsoleFormatter;
-
- Logger = require(__dirname + '/logger').Logger;
-
- _ref1 = require(__dirname + '/transport'), Transport = _ref1.Transport, ConsoleTransport = _ref1.ConsoleTransport;
-
- module.exports = {
- cliColor: cliColor,
- Formatter: Formatter,
- ConsoleFormatter: ConsoleFormatter,
- Logger: Logger,
- Transport: Transport,
- ConsoleTransport: ConsoleTransport
- };
-
-}).call(this);
View
210 lib/formatter.js
@@ -1,210 +0,0 @@
-// Generated by CoffeeScript 1.3.1
-(function() {
- var ConsoleFormatter, Formatter, cliColor, util,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
-
- util = require('util');
-
- cliColor = require('cli-color');
-
- Formatter = (function() {
-
- Formatter.name = 'Formatter';
-
- Formatter.prototype.config = {
- colors: {
- 0: 'red',
- 1: 'red',
- 2: 'red',
- 3: 'red',
- 4: 'yellow',
- 5: 'yellow',
- 6: 'green',
- 7: 'green'
- },
- level: 7
- };
-
- function Formatter(config) {
- var key, value, _ref;
- config || (config = {});
- _ref = this.config;
- for (key in _ref) {
- if (!__hasProp.call(_ref, key)) continue;
- value = _ref[key];
- if (config[key] == null) {
- config[key] = value;
- }
- }
- this.config = config;
- }
-
- Formatter.prototype.getLevel = function() {
- var _ref;
- return (_ref = this.config.level) != null ? _ref : null;
- };
-
- Formatter.prototype.setLevel = function(level) {
- this.config.level = level;
- return this;
- };
-
- Formatter.prototype.padLeft = function(padding, size, msg) {
- var i, _i, _ref;
- padding = String(padding);
- msg = String(msg);
- if (msg.length < size) {
- for (i = _i = 0, _ref = size - msg.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
- msg = padding + msg;
- }
- }
- return msg;
- };
-
- Formatter.prototype.padRight = function(padding, size, msg) {
- var i, _i, _ref;
- padding = String(padding);
- msg = String(msg);
- if (msg.length < size) {
- for (i = _i = 0, _ref = size - msg.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
- msg += padding;
- }
- }
- return msg;
- };
-
- Formatter.prototype.details = function(levelCode, levelName, args) {
- var color, date, file, index, line, message, method, parts, value, _i, _len, _ref;
- date = this.getDate();
- _ref = this.getLineInfo(), file = _ref.file, line = _ref.line, method = _ref.method;
- color = this.getColor(levelCode);
- parts = [];
- for (index = _i = 0, _len = args.length; _i < _len; index = ++_i) {
- value = args[index];
- parts[index] = typeof value === 'string' ? value : util.inspect(value, false, 10);
- }
- message = parts.join(' ');
- return {
- date: date,
- file: file,
- line: line,
- method: method,
- color: color,
- levelName: levelName,
- message: message
- };
- };
-
- Formatter.prototype.format = function(levelCode, levelName, args) {
- var className, date, line, message, _ref;
- _ref = this.details(levelCode, levelName, args), date = _ref.date, className = _ref.className, line = _ref.line, levelName = _ref.levelName, message = _ref.message;
- if (this.config.level === 7) {
- return message = ("[" + date + "] [" + className + ": " + line + "] ") + this.padLeft(' ', 10, "" + levelName + ":") + (" " + message);
- } else {
- return message = this.padLeft(' ', 10, "" + levelName + ":") + (" " + message);
- }
- };
-
- Formatter.prototype.getColor = function(levelCode) {
- var color;
- return color = this.config.colors ? this.config.colors[levelCode] : false;
- };
-
- Formatter.prototype.getDate = function() {
- var date, hours, minutes, month, ms, now, seconds, year;
- now = new Date();
- year = now.getFullYear();
- month = this.padLeft('0', 2, now.getMonth() + 1);
- date = this.padLeft('0', 2, now.getDate());
- hours = this.padLeft('0', 2, now.getHours());
- minutes = this.padLeft('0', 2, now.getMinutes());
- seconds = this.padLeft('0', 2, now.getSeconds());
- ms = this.padLeft('0', 3, now.getMilliseconds());
- return "" + year + "-" + month + "-" + date + " " + hours + ":" + minutes + ":" + seconds + "." + ms;
- };
-
- Formatter.prototype.getLineInfo = function() {
- var line, lines, parts, result, _i, _len;
- result = {
- line: -1,
- method: 'unknown'
- };
- try {
- throw new Error();
- } catch (e) {
- lines = e.stack.split('\n');
- for (_i = 0, _len = lines.length; _i < _len; _i++) {
- line = lines[_i];
- if (line.indexOf(__dirname) !== -1 || line.indexOf(' at ') === -1) {
- continue;
- }
- parts = line.split(':');
- if (parts[0].indexOf('(') === -1) {
- result.method = 'unknown';
- result.file = parts[0].replace(/^.+?\s+at\s+/, '');
- } else {
- result.method = parts[0].replace(/^.+?\s+at\s+/, '').replace(/\s+\(.+$/, '');
- result.file = parts[0].replace(/^.+?\(/, '');
- }
- result.line = parts[1];
- break;
- }
- }
- return result;
- };
-
- return Formatter;
-
- })();
-
- ConsoleFormatter = (function(_super) {
-
- __extends(ConsoleFormatter, _super);
-
- ConsoleFormatter.name = 'ConsoleFormatter';
-
- function ConsoleFormatter() {
- return ConsoleFormatter.__super__.constructor.apply(this, arguments);
- }
-
- ConsoleFormatter.prototype.format = function(levelCode, levelName, args) {
- var color, date, debugFormatter, debugString, file, line, message, messageFormatter, messageString, method, seperator, _ref;
- _ref = this.details(levelCode, levelName, args), date = _ref.date, file = _ref.file, line = _ref.line, method = _ref.method, color = _ref.color, levelName = _ref.levelName, message = _ref.message;
- if (!message) {
- return message;
- } else {
- color = color && cliColor[color] || function(str) {
- return str;
- };
- levelName = color(levelName + ':');
- debugFormatter = false;
- messageFormatter = cliColor.bold;
- messageString = "" + levelName + " " + message;
- if (messageFormatter) {
- messageString = messageFormatter(messageString);
- }
- if (this.config.level === 7) {
- seperator = '\n';
- debugString = "[" + date + "] [" + file + ":" + line + "] [" + method + "]";
- if (debugFormatter) {
- debugString = lineFormatter(debugString);
- }
- return message = "" + messageString + seperator + debugString;
- } else {
- return message = messageString;
- }
- }
- };
-
- return ConsoleFormatter;
-
- })(Formatter);
-
- module.exports = {
- cliColor: cliColor,
- Formatter: Formatter,
- ConsoleFormatter: ConsoleFormatter
- };
-
-}).call(this);
View
176 lib/logger.js
@@ -1,176 +0,0 @@
-// Generated by CoffeeScript 1.3.1
-(function() {
- var ConsoleTransport, Logger, Transport, _ref,
- __hasProp = {}.hasOwnProperty,
- __slice = [].slice;
-
- _ref = require(__dirname + '/transport'), Transport = _ref.Transport, ConsoleTransport = _ref.ConsoleTransport;
-
- Logger = (function() {
-
- Logger.name = 'Logger';
-
- Logger.prototype.config = {
- autoFlush: true,
- transports: null,
- level: 7,
- levels: {
- emergency: 0,
- alert: 1,
- critical: 2,
- error: 3,
- warning: 4,
- notice: 5,
- info: 6,
- debug: 7,
- emerg: 0,
- crit: 2,
- err: 3,
- warn: 4,
- note: 5,
- "default": 6
- }
- };
-
- Logger.prototype.messages = [];
-
- Logger.prototype.formatter = null;
-
- Logger.prototype.transports = [];
-
- function Logger(config) {
- var key, levels, transport, value, _i, _len, _ref1, _ref2, _ref3;
- this.messages = [];
- this.transports = [];
- config || (config = {});
- _ref1 = this.config;
- for (key in _ref1) {
- if (!__hasProp.call(_ref1, key)) continue;
- value = _ref1[key];
- if (config[key] == null) {
- config[key] = value;
- }
- }
- levels = {};
- _ref2 = config.levels;
- for (key in _ref2) {
- if (!__hasProp.call(_ref2, key)) continue;
- value = _ref2[key];
- if (levels[key] == null) {
- levels[key] = value;
- }
- }
- config.levels = levels;
- if (!config.transports) {
- config.transports = new ConsoleTransport;
- }
- if (!(config.transports instanceof Array)) {
- config.transports = [config.transports];
- }
- _ref3 = config.transports;
- for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
- transport = _ref3[_i];
- if (transport instanceof Transport) {
- this.transports.push(transport);
- } else if (transport) {
- this.transports.push(new ConsoleTransport(transport));
- }
- }
- delete config.transports;
- if (config.level) {
- this.setLevel(config.level);
- }
- this.config = config;
- }
-
- Logger.prototype.getLevel = function() {
- var _ref1;
- return (_ref1 = this.config.level) != null ? _ref1 : null;
- };
-
- Logger.prototype.setLevel = function(level) {
- var transport, _i, _len, _ref1;
- this.config.level = level;
- _ref1 = this.transports;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- transport = _ref1[_i];
- transport.setLevel(level);
- }
- return this;
- };
-
- Logger.prototype.getLevelCode = function(name) {
- var _ref1;
- return (_ref1 = this.config.levels[name]) != null ? _ref1 : null;
- };
-
- Logger.prototype.getLevelName = function(code) {
- var key, value, _ref1;
- _ref1 = this.config.levels;
- for (key in _ref1) {
- if (!__hasProp.call(_ref1, key)) continue;
- value = _ref1[key];
- if (value === code) {
- return key;
- }
- }
- return null;
- };
-
- Logger.prototype.log = function() {
- var args, level, levelCode, levelName;
- level = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
- if (typeof level === 'number') {
- levelCode = level;
- levelName = this.getLevelName(levelCode);
- } else {
- levelName = level;
- levelCode = this.getLevelCode(levelName);
- levelName = this.getLevelName(levelCode);
- if (levelCode == null) {
- levelCode = this.getLevelCode('default');
- levelName = this.getLevelName(levelCode);
- args.unshift(level);
- }
- }
- if (this.config.autoFlush) {
- this.write(levelCode, levelName, args);
- } else {
- this.messages.push({
- levelCode: levelCode,
- levelName: levelName,
- args: args
- });
- }
- return this;
- };
-
- Logger.prototype.flush = function() {
- var args, levelCode, levelName, _i, _len, _ref1, _ref2;
- _ref1 = this.messages;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- _ref2 = _ref1[_i], levelCode = _ref2.levelCode, levelName = _ref2.levelName, args = _ref2.args;
- this.write(levelCode, levelName, args);
- }
- return this;
- };
-
- Logger.prototype.write = function(levelCode, levelName, args) {
- var transport, _i, _len, _ref1;
- _ref1 = this.transports;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- transport = _ref1[_i];
- transport.write(levelCode, levelName, args);
- }
- return this;
- };
-
- return Logger;
-
- })();
-
- module.exports = {
- Logger: Logger
- };
-
-}).call(this);
View
93 lib/transport.js
@@ -1,93 +0,0 @@
-// Generated by CoffeeScript 1.3.1
-(function() {
- var ConsoleFormatter, ConsoleTransport, Formatter, Transport, _ref,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
-
- _ref = require(__dirname + '/formatter'), Formatter = _ref.Formatter, ConsoleFormatter = _ref.ConsoleFormatter;
-
- Transport = (function() {
-
- Transport.name = 'Transport';
-
- Transport.prototype.config = {
- level: 7,
- formatter: null
- };
-
- function Transport(config) {
- var key, value, _ref1;
- config || (config = {});
- _ref1 = this.config;
- for (key in _ref1) {
- if (!__hasProp.call(_ref1, key)) continue;
- value = _ref1[key];
- if (config[key] == null) {
- config[key] = value;
- }
- }
- if (config.formatter instanceof Formatter) {
- this.formatter = config.formatter;
- } else {
- this.formatter = new ConsoleFormatter(config.formatter);
- }
- delete config.formatter;
- this.config = config;
- }
-
- Transport.prototype.getLevel = function() {
- var _ref1;
- return (_ref1 = this.config.level) != null ? _ref1 : null;
- };
-
- Transport.prototype.setLevel = function(level) {
- this.config.level = level;
- if (this.formatter) {
- this.formatter.setLevel(level);
- }
- return this;
- };
-
- Transport.prototype.care = function(levelCode) {
- return levelCode <= this.config.level;
- };
-
- Transport.prototype.write = function(levelCode, levelName, message) {
- if (this.care(levelCode)) {
- return message = this.formatter.format(levelCode, levelName, message);
- } else {
- return null;
- }
- };
-
- return Transport;
-
- })();
-
- ConsoleTransport = (function(_super) {
-
- __extends(ConsoleTransport, _super);
-
- ConsoleTransport.name = 'ConsoleTransport';
-
- function ConsoleTransport() {
- return ConsoleTransport.__super__.constructor.apply(this, arguments);
- }
-
- ConsoleTransport.prototype.write = function(levelCode, levelName, message) {
- message = ConsoleTransport.__super__.write.call(this, levelCode, levelName, message);
- if (message != null) {
- return console.log(message);
- }
- };
-
- return ConsoleTransport;
-
- })(Transport);
-
- module.exports = {
- Transport: Transport,
- ConsoleTransport: ConsoleTransport
- };
-
-}).call(this);
View
9 package.json
@@ -1,6 +1,6 @@
{
"name": "caterpillar",
- "version": "1.1.1",
+ "version": "1.1.2",
"description": "Caterpillar is an awesome, simple console logger for node.js. It supports grouping of messages, filtering log levels, colors, times, modules, custom formatters and custom transports. It's awesome.",
"homepage": "https://github.com/bevry/caterpillar",
"keywords": [
@@ -35,10 +35,7 @@
"docco": "0.3.x"
},
"directories": {
- "lib": "lib"
+ "lib": "./out/lib"
},
- "scripts": {
- "test": "node ./node_modules/mocha/bin/mocha"
- },
- "main": "./lib/caterpillar"
+ "main": "./out/lib/caterpillar"
}
View
0 src/caterpillar.coffee → src/lib/caterpillar.coffee
File renamed without changes.
View
0 src/formatter.coffee → src/lib/formatter.coffee
File renamed without changes.
View
0 src/logger.coffee → src/lib/logger.coffee
File renamed without changes.
View
0 src/transport.coffee → src/lib/transport.coffee
File renamed without changes.

0 comments on commit 43964a5

Please sign in to comment.