All Projects → okwolf → hyperapp-logger

okwolf / hyperapp-logger

Licence: MIT license
Log Hyperapp state updates and action information to the console.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to hyperapp-logger

Gradle Test Logger Plugin
A Gradle plugin for printing beautiful logs on the console while running tests
Stars: ✭ 460 (+858.33%)
Mutual labels:  console, logger
Signale
Highly configurable logging utility
Stars: ✭ 8,575 (+17764.58%)
Mutual labels:  console, logger
debug.js
Debugger of JavaScript, by JavaScript, for JavaScript
Stars: ✭ 19 (-60.42%)
Mutual labels:  console, logger
logt
🖥️ A colourful logger for the browser
Stars: ✭ 35 (-27.08%)
Mutual labels:  console, logger
capybara-chromedriver-logger
Enables console.log/error/info output from Javascript feature specs running with Chromedriver
Stars: ✭ 54 (+12.5%)
Mutual labels:  console, logger
Laravel Console Logger
Logging and Notifications for Laravel Console Commands.
Stars: ✭ 79 (+64.58%)
Mutual labels:  console, logger
Loglevelnext
A modern logging library for Node.js that provides log level mapping to the console
Stars: ✭ 33 (-31.25%)
Mutual labels:  console, logger
LoggingAdvanced
Improved and patched .NET Core console logger.
Stars: ✭ 20 (-58.33%)
Mutual labels:  console, logger
Go Logger
一个简单而强大的 golang 日志工具包,支持同步和异步输出到 命令行,文件, api 接口,文件支持按文件大小,文件行数,日期切分;A simple and powerful golang logging toolkit that supports synchronous and asynchronous output to the console, file, API interfaces, file support by file size, file line number, date sharding.
Stars: ✭ 152 (+216.67%)
Mutual labels:  console, logger
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 (+185.42%)
Mutual labels:  console, logger
webpack-log
A logger for the Webpack ecosystem
Stars: ✭ 18 (-62.5%)
Mutual labels:  console, logger
ptkdev-logger
🦒 Beautiful Logger for Node.js: the best alternative to the console.log statement
Stars: ✭ 117 (+143.75%)
Mutual labels:  console, logger
Slim-Console
Slim Framework Console
Stars: ✭ 26 (-45.83%)
Mutual labels:  console
python-sdk
python sdk for FISCO BCOS
Stars: ✭ 53 (+10.42%)
Mutual labels:  console
xtd
Free open-source modern C++17 / C++20 framework to create console, forms (GUI like WinForms) and unit test applications on Microsoft Windows, Apple macOS and Linux.
Stars: ✭ 321 (+568.75%)
Mutual labels:  console
cpp-indicators
A very simple, easy-to-use, and single-header-only C++ library for console based indicators (loading spinners)
Stars: ✭ 13 (-72.92%)
Mutual labels:  console
TerminalConsoleAppender
JLine 3 appender for Log4j2, allows extending command line apps using colors and command completion
Stars: ✭ 49 (+2.08%)
Mutual labels:  console
knex-tiny-logger
Zero config queries logger for knex
Stars: ✭ 24 (-50%)
Mutual labels:  logger
chessIO
Fast haskell chess move generator library and console UCI frontend
Stars: ✭ 25 (-47.92%)
Mutual labels:  console
impress-cli
Impress Application Server Command line interface
Stars: ✭ 25 (-47.92%)
Mutual labels:  console

Hyperapp Logger

Build Status Codecov npm

A Hyperapp dispatch initializer that logs state updates and action information to the console.

Getting Started

This example shows a counter that can be incremented or decremented. Go ahead and try it online with your browser console open to see the log messages.

import { app } from "hyperapp";
import logger from "hyperapp-logger";

const Up = state => state + 1;
const Down = state => state - 1;

app({
  init: 0,
  view: state => (
    <main>
      <h1>{state.count}</h1>
      <button onclick={Down}></button>
      <button onclick={Up}></button>
    </main>
  ),
  node: document.getElementById("app"),
  dispatch: logger
});

Screenshot

Installation

Node.js

Install with npm / Yarn.

npm i hyperapp-logger

Then with a module bundler like rollup or webpack use as you would anything else.

import logger from "hyperapp-logger";

Browser

Download the minified library from the CDN.

<script src="https://unpkg.com/hyperapp-logger"></script>

You can find the library in window.hyperappLogger.

Usage

import logger from "hyperapp-logger";

app({
  init,
  view,
  node,
  dispatch: logger
});

// Or if you need to pass options
app({
  init,
  view,
  node,
  dispatch: logger(options)
});

Options

options.log

Use it to customize the log function.

app({
  init,
  view,
  node,
  dispatch: logger({
    log(state, action, props, actionResult) {
      // format and send your log messages anywhere you like
    }
  })
});

License

Hyperapp Logger is MIT licensed. See LICENSE.

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].