Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
mobx-logger
Advanced tools
Always know what is really going on in your MobX application by logging just the right information.
★★★ Like this project? Leave a star, follow on Twitter or donate to support my work! Thanks. ★★★
NPM: npm install mobx-logger
CDN: https://unpkg.com/mobx-logger/mobx-logger.umd.js
import {enableLogging} from 'mobx-logger';
// optional
const config = {...};
enableLogging(config);
For Mobx 3 support please use Mobx Logger 0.6.0.
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
}
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
).
For ReactNative development use this predicate to only enable logging in dev mode with JS debugging enabled:
enableLogging({
predicate: () => __DEV__ && Boolean(window.navigator.userAgent),
...
});
MIT
FAQs
Mobx Logger
The npm package mobx-logger receives a total of 5,285 weekly downloads. As such, mobx-logger popularity was classified as popular.
We found that mobx-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.