All Projects → effector → Logger

effector / Logger

Simple logger with stores inspector

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Logger

gxlog
A concise, functional, flexible and extensible logger for go.
Stars: ✭ 65 (+12.07%)
Mutual labels:  log, logger
Eylogviewer
A simple viewer to see your app's logs on your iDevice in realtime.
Stars: ✭ 16 (-72.41%)
Mutual labels:  log, logger
esp-logger
An Arduino library providing a minimal interface to log data on flash memory and SD cards with ESP8266 and ESP32
Stars: ✭ 40 (-31.03%)
Mutual labels:  log, logger
Serverless Es Logs
A Serverless plugin to transport logs to ElasticSearch
Stars: ✭ 51 (-12.07%)
Mutual labels:  log, logger
Logutils
More convenient and easy to use android Log manager
Stars: ✭ 1,035 (+1684.48%)
Mutual labels:  log, logger
printer
A fancy logger yet lightweight, and configurable. 🖨
Stars: ✭ 65 (+12.07%)
Mutual labels:  log, logger
Objectlogger
A powerful and easy-to-use operational logging system that supports analysis of changes in object properties. 强大且易用的操作日志记录系统,支持对象属性的变化分析。
Stars: ✭ 378 (+551.72%)
Mutual labels:  log, logger
laravel-loggable
🎥 📽 🎞 Log your model changes in multiple ways
Stars: ✭ 58 (+0%)
Mutual labels:  log, logger
Loglevelnext
A modern logging library for Node.js that provides log level mapping to the console
Stars: ✭ 33 (-43.1%)
Mutual labels:  log, logger
Gollum
An n:m message multiplexer written in Go
Stars: ✭ 883 (+1422.41%)
Mutual labels:  log, logger
ip-logger
📇 When someone clicks the link, you will receive their IP and other information via telegram.
Stars: ✭ 0 (-100%)
Mutual labels:  log, logger
Logcustom
A simple log customization tool based on golang 一个基于golang简单的日志定制化工具
Stars: ✭ 46 (-20.69%)
Mutual labels:  log, logger
polog
Логирование должно быть красивым
Stars: ✭ 26 (-55.17%)
Mutual labels:  log, logger
horse-logger
Middleware for access logging in HORSE
Stars: ✭ 25 (-56.9%)
Mutual labels:  log, logger
dlog
A super simple logger for Go. Supports stderr, logfiles, syslog and windows event log.
Stars: ✭ 16 (-72.41%)
Mutual labels:  log, logger
Cocoadebug
iOS Debugging Tool 🚀
Stars: ✭ 3,769 (+6398.28%)
Mutual labels:  log, logger
debug.js
Debugger of JavaScript, by JavaScript, for JavaScript
Stars: ✭ 19 (-67.24%)
Mutual labels:  log, logger
ctrace-go
Canonical OpenTracing for GoLang
Stars: ✭ 12 (-79.31%)
Mutual labels:  log, logger
Laravel Log
Simple API to write logs for Laravel.
Stars: ✭ 19 (-67.24%)
Mutual labels:  log, logger
Plog
Portable, simple and extensible C++ logging library
Stars: ✭ 1,061 (+1729.31%)
Mutual labels:  log, logger

Effector Logger

Pretty logger for stores, events, effects and domains.

All Contributors

Chrome-DevTools-Console
Chrome-DevTools-Console-Dark

Installation

npm install effector
npm install --dev effector-logger

or yarn

yarn add effector
yarn add -D effector-logger

Note: effector-logger requires effector to be installed

Usage

Add babel plugin to your babel.config.js or .babelrc file

babel-plugin included to effector package

{
  "plugins": [["effector/babel-plugin", { "addLoc": true }]]
}

Create React App and macros support

Just use effector-logger/macro:

import { createStore, createEvent } from 'effector-logger/macro';

Debug some modules

  1. Open a module (js/ts/esm file) you need to debug

Replace import from "effector" to "effector-logger"

For example:

- import { Event, Store, createEvent, forward } from "effector"
+ import { Event, Store, createEvent, forward } from "effector-logger"
  1. Open DevTools Console, use "Filter" to show only required logs

Debug domain with settings

  1. Open a module with domain
  2. import { attachLogger } from 'effector-logger/attach'
  3. Attach logger to your domain

Example:

import { createDomain } from 'effector';
import { attachLogger } from 'effector-logger/attach';

export const myDomain = createDomain('my');
attachLogger(myDomain);

Settings available only on attachLogger

Second argument is an object { reduxDevtools, console, inspector }, each field is optional can be "enabled" or "disabled". If field is not provided it is "enabled" by default.

  • reduxDevtools if "disabled" do not send updates to redux devtools extension
  • inspector if "disabled" do not send updates to effector inspector
  • console if "disabled" do not log updates to console.log in browser devtools
// disable all logs
attachLogger(myDomain, {
  reduxDevtools: 'disabled',
  inspector: 'disabled',
  console: 'disabled',
});

effector-root

Just import root domain and attach:

import { attachLogger } from 'effector-logger/attach';
import { root } from 'effector-root';

attachLogger(root);

Create React App and macros support

import { attachLogger } from 'effector-logger/attach';
import { root } from 'effector-root/macro';

attachLogger(root);

Inspector

In root file on the client side import createInspector from effector-logger/inspector, and call it after app initialized.

Note: inspector requires browser environment. ReactNative is not supported

import { createInspector } from 'effector-logger/inspector';
/* App initialization here */
createInspector();

Redux DevTools support

If you have redux devtools extensions, just open it.

Using in the project with Redux

If you are using [email protected] and lower with effector-logger in the project with redux, then you need to rewrite redux createStore import to createReduxStore and use it. Otherwise redux will give you an error: Unexpected keys found in preloadedState argument passed to createStore.

import { createStore as createReduxStore } from 'redux';

const store = createReduxStore();
// reducers

Using logger with SSR

import { attachLogger } from 'effector-logger/attach';
import { root, fork, hydrate } from 'effector-root';

const scope = fork(root);
hydrate(scope, { values: INITIAL_STATE });
attachLogger(scope);

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Andrey Antropov

💻

Sergey Sova

💻

Sozonov

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

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