All Projects → helpers → Logging Helpers

helpers / Logging Helpers

Licence: mit
Basic template helpers for printing messages out to the console. Useful for debugging context in templates. Should work with any template engine.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Logging Helpers

Console
OS X console application.
Stars: ✭ 298 (+5860%)
Mutual labels:  console, logging, log
Loglevelnext
A modern logging library for Node.js that provides log level mapping to the console
Stars: ✭ 33 (+560%)
Mutual labels:  console, logging, log
Handlebars Helpers
Related projects
Stars: ✭ 2,024 (+40380%)
Mutual labels:  helper, helpers, handlebars
Quicklogger
Library for logging on files, console, memory, email, rest, eventlog, syslog, slack, telegram, redis, logstash, elasticsearch, influxdb, graylog, Sentry, Twilio, ide debug messages and throw events for Delphi/Firemonkey/freepascal/.NET (Windows/Linux/OSX/IOS/Android).
Stars: ✭ 137 (+2640%)
Mutual labels:  console, logging, log
Electron Log
Just a simple logging module for your Electron application
Stars: ✭ 765 (+15200%)
Mutual labels:  console, logging, log
Tinyconsole
📱💬🚦 TinyConsole is a micro-console that can help you log and display information inside an iOS application, where having a connection to a development computer is not possible.
Stars: ✭ 1,929 (+38480%)
Mutual labels:  console, helper, log
Log
Console.log with style.
Stars: ✭ 2,766 (+55220%)
Mutual labels:  console, log
Home
Project Glimpse: Node Edition - Spend less time debugging and more time developing.
Stars: ✭ 260 (+5100%)
Mutual labels:  console, logging
Dozzle
Realtime log viewer for docker containers.
Stars: ✭ 684 (+13580%)
Mutual labels:  logging, log
Borgert Cms
Borgert is a CMS Open Source created with Laravel Framework 5.6
Stars: ✭ 298 (+5860%)
Mutual labels:  logging, log
debug.js
Debugger of JavaScript, by JavaScript, for JavaScript
Stars: ✭ 19 (+280%)
Mutual labels:  console, log
Consola
Elegant Console Logger for Node.js and Browser 🐨
Stars: ✭ 3,461 (+69120%)
Mutual labels:  console, log
Daiquiri
Python library to easily setup basic logging functionality
Stars: ✭ 308 (+6060%)
Mutual labels:  logging, log
gxlog
A concise, functional, flexible and extensible logger for go.
Stars: ✭ 65 (+1200%)
Mutual labels:  log, logging
ComoFazerUmaPerguntaPT
🤔 Farto de fazer perguntas e não ser respondido? Aprenda agora a melhor forma de fazer uma pergunta 🔥
Stars: ✭ 28 (+460%)
Mutual labels:  helper, helpers
Oklog
A distributed and coördination-free log management system
Stars: ✭ 2,937 (+58640%)
Mutual labels:  logging, log
UE4 MagicConsole
Enhanced UE4 output log widget
Stars: ✭ 71 (+1320%)
Mutual labels:  console, log
Cutelog
GUI for logging
Stars: ✭ 386 (+7620%)
Mutual labels:  logging, log
Log Process Errors
Show some ❤️ to Node.js process errors
Stars: ✭ 424 (+8380%)
Mutual labels:  logging, error
React Log
React for the Console
Stars: ✭ 553 (+10960%)
Mutual labels:  logging, log

logging-helpers NPM version NPM monthly downloads NPM total downloads Linux Build Status

Basic template helpers for printing messages out to the console. Useful for debugging context in templates. Should work with any template engine.

Install

Install with npm:

$ npm install --save logging-helpers

Usage

The main export is the log helper function with other helpers decorated as properties on this function. Some apps, like assemble, verb and generate support this format. However, a non-enumberalbe toObject method is exposed for registering directly with engines like handlebars

Example:

var loggingHelpers = require('logging-helpers');
var hbs = require('handlebars');

hbs.registerHelper('log', helpers);
// register all of the other helpers
hbs.registerHelper(helpers.toObject);

Template examples

Handlebars:

{{log "%s" "this is a message"}}
{{info "%s" "this is a message"}}
{{warning "%s" "this is a message"}}
{{warn "%s" "this is a message"}}  <!-- alias for "warning" -->
{{success "%s" "this is a message"}}
{{error "%s" "this is a message"}}
{{danger "%s" "this is a message"}}  <!-- alias for "error" -->
{{ok "%s" "this is a message"}}
{{bold "%s" "this is a message"}}
{{_debug this}}
{{_inspect foo.bar}}

Lo-Dash or Underscore:

<%= log("%s", "this is a message") %>
<%= info("%s", "this is a message") %>
<%= warn("%s", "this is a message") %>
<%= warning("%s", "this is a message") %>
<%= error("%s", "this is a message") %>
<%= bold("%s", "this is a message") %>
<%= _debug(data) %>
<%= _inspect(foo.bar) %>

Verb (uses lodash-style templates, but with special delimiters to avoid delimiter collision in documentation):

{%= log("%s", "this is a message") %}
{%= info("%s", "this is a message") %}
{%= bold("%s", "this is a message") %}
{%= warn("%s", "this is a message") %}
{%= error("%s", "this is a message") %}
{%= debug(data) %}
{%= inspect(foo.bar) %}

Usage with assemble

This should work with assemble, verb, generate, update or any application based on templates.

var helpers = require('logging-helpers');
var assemble = require('assemble');
var app = assemble();
app.helpers(helpers);

You can now use the helpers like this:

{{log "%s" "this is a message"}}
{{info "%s" "this is a message"}}
{{warning "%s" "this is a message"}}
{{warn "%s" "this is a message"}}  <!-- alias for "warning" -->
{{success "%s" "this is a message"}}
{{error "%s" "this is a message"}}
{{danger "%s" "this is a message"}}  <!-- alias for "error" -->
{{ok "%s" "this is a message"}}
{{bold "%s" "this is a message"}}
{{_debug this}}
{{_inspect foo.bar}}

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Author

Jon Schlinkert

License

Copyright © 2017, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.6.0, on June 21, 2017.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].