All Projects → winterbe → Mobx Logger

winterbe / Mobx Logger

Licence: mit
Log Mobx Actions, Reactions, Transactions and Computations

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Mobx Logger

Mobx React Lite
Lightweight React bindings for MobX based on React 16.8 and Hooks
Stars: ✭ 2,096 (+898.1%)
Mutual labels:  mobx
Logcat
Android 日志打印框架,在手机上可以直接看到 Logcat 日志啦
Stars: ✭ 189 (-10%)
Mutual labels:  logger
Wiretap
🔍 A desktop app for inspecting mobx and mobx state tree apps
Stars: ✭ 198 (-5.71%)
Mutual labels:  mobx
Lajax
🚀 lajax - 前端日志解决方案。
Stars: ✭ 181 (-13.81%)
Mutual labels:  logger
Feathers React Native Chat
A React Native example chat app using feathers
Stars: ✭ 189 (-10%)
Mutual labels:  mobx
Flutter book
Flutter1.17.x book App,使用Mobx数据管理器支持Android和iOS,使用库json_serializable、json_annotation、dio。
Stars: ✭ 190 (-9.52%)
Mutual labels:  mobx
Taming The State In React
📓Taming the State in React: Your journey to master Redux and MobX
Stars: ✭ 169 (-19.52%)
Mutual labels:  mobx
Abap Logger
ABAP Logging as painless as any other language
Stars: ✭ 201 (-4.29%)
Mutual labels:  logger
Acho
The Hackable Log
Stars: ✭ 189 (-10%)
Mutual labels:  logger
Xlog
Android logger, pretty, powerful and flexible, log to everywhere, save to file, all you want is here.
Stars: ✭ 2,468 (+1075.24%)
Mutual labels:  logger
Logger
✔️ Simple, pretty and powerful logger for android
Stars: ✭ 13,093 (+6134.76%)
Mutual labels:  logger
Pino Colada
cute ndjson formatter for pino 🌲🍹
Stars: ✭ 189 (-10%)
Mutual labels:  logger
Mobx Share
🔑一个分享mobx的在线演示ppt
Stars: ✭ 196 (-6.67%)
Mutual labels:  mobx
Easy Log Handler
Human-friendly log files that make you more productive
Stars: ✭ 2,070 (+885.71%)
Mutual labels:  logger
Ring Log
Ring-Log是一个高效简洁的C++异步日志, 其特点是效率高(每秒支持至少125万+日志写入)、易拓展,尤其适用于频繁写日志的场景
Stars: ✭ 201 (-4.29%)
Mutual labels:  logger
React Hooks Mobx State Tree
React Hooks + MobX State Tree + TypeScript = 💛
Stars: ✭ 169 (-19.52%)
Mutual labels:  mobx
Alldemo
🍑 2020全栈学习Demo大合集 包含最新 hooks TS 等 还有umi+dva,数据可视化等实战项目 (持续更新中)
Stars: ✭ 189 (-10%)
Mutual labels:  mobx
Wechat Weapp Mobx
微信小程序(wechat weapp) mobx 绑定, 跨页面通信的利器, 现已发布npm包
Stars: ✭ 208 (-0.95%)
Mutual labels:  mobx
Saas
Build your own SaaS business with SaaS boilerplate. Productive stack: React, Material-UI, Next, MobX, WebSockets, Express, Node, Mongoose, MongoDB. Written with TypeScript.
Stars: ✭ 2,720 (+1195.24%)
Mutual labels:  mobx
Saf Kotlin Log
完全基于 Kotlin 开发的 Android 日志框架,提供极简的 API
Stars: ✭ 195 (-7.14%)
Mutual labels:  logger

MobX Logger

Always know what is really going on in your MobX application by logging just the right information.

mobx-logger


★★★ Like this project? Leave a star, follow on Twitter or donate to support my work! Thanks. ★★★

Install

NPM: npm install mobx-logger

CDN: https://unpkg.com/mobx-logger/mobx-logger.umd.js

Usage

import {enableLogging} from 'mobx-logger';

// optional
const config = {...};

enableLogging(config);

For Mobx 3 support please use Mobx Logger 0.6.0.

Options

Unlike MobX DevTools you can simply configure which particular information should be logged to the console. Currently Actions, Reactions, Transactions and Computations are supported.

{
    predicate: () => true|false,
    action: true|false,
    reaction: true|false,
    transaction: true|false,
    compute: true|false
}

Logger Config

You can disable logging for actions and computed properties by providing a static mobxLoggerConfig. This is useful to keep the console log clean, e.g. when using a large amount of Mobx models which would result in alot of console logs.

Here's an example of how to disable logging for all actions and computed properties for a given class:

class MyModel {
    static mobxLoggerConfig: {
        enabled: false
    };
    
    // ...
}

Alternatively you can disable logging for particular class methods:

class MyStore {
    static mobxLoggerConfig: {
        methods: {
            myAction: false
        }
    };
    
    @action myAction() {
        // calls to this method won't be logged
    }
}

You can combine the above examples to whitelist certain actions for being logged:

class MyStore {
    static mobxLoggerConfig: {
        enabled: false,
        methods: {
            myAction: true
        }
    };
    
    @action myAction() {
        // only calls to this method are being logged
    }
    
    // other methods won't be logged ...
}

Please keep in mind that at this point mobxLoggerConfig is only available for actions (@action) and computed properties (@computed).

ReactNative

For ReactNative development use this predicate to only enable logging in dev mode with JS debugging enabled:

enableLogging({
    predicate: () => __DEV__ && Boolean(window.navigator.userAgent),
    ...
});

License

MIT

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