{"id":28469240,"url":"https://github.com/winterbe/mobx-logger","last_synced_at":"2025-07-01T14:31:22.520Z","repository":{"id":10613085,"uuid":"66352269","full_name":"winterbe/mobx-logger","owner":"winterbe","description":"Log Mobx Actions, Reactions, Transactions and Computations","archived":false,"fork":false,"pushed_at":"2023-04-04T15:10:13.000Z","size":738,"stargazers_count":231,"open_issues_count":22,"forks_count":11,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-06-07T08:42:35.482Z","etag":null,"topics":["javascript","logger","mobx"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/mobx-logger","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/winterbe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-08-23T09:17:19.000Z","updated_at":"2024-10-23T15:23:11.000Z","dependencies_parsed_at":"2023-01-13T16:02:49.577Z","dependency_job_id":"b8c0e80e-1063-4d39-b63e-bfe8c7f49e65","html_url":"https://github.com/winterbe/mobx-logger","commit_stats":{"total_commits":27,"total_committers":5,"mean_commits":5.4,"dds":0.2222222222222222,"last_synced_commit":"f5e798c0e100b393a8358f08633d6b17c00efed2"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/winterbe/mobx-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winterbe%2Fmobx-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winterbe%2Fmobx-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winterbe%2Fmobx-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winterbe%2Fmobx-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/winterbe","download_url":"https://codeload.github.com/winterbe/mobx-logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winterbe%2Fmobx-logger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262980983,"owners_count":23394445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","logger","mobx"],"created_at":"2025-06-07T08:30:59.013Z","updated_at":"2025-07-01T14:31:22.490Z","avatar_url":"https://github.com/winterbe.png","language":"JavaScript","readme":"# MobX Logger\n\n\u003e Always know what is really going on in your MobX application by logging just the right information.\n\n![mobx-logger](https://raw.githubusercontent.com/winterbe/mobx-logger/master/docs/screenshot.png)\n\n---\n\n\u003cp align=\"center\"\u003e\n\u003cstrong\u003e★★★ Like this project? \u003ca href=\"https://github.com/winterbe/mobx-logger/stargazers\"\u003eLeave a star\u003c/a\u003e, \u003ca href=\"https://twitter.com/winterbe_\"\u003efollow on Twitter\u003c/a\u003e or \u003ca href=\"https://www.paypal.me/winterbe\"\u003edonate\u003c/a\u003e to support my work! Thanks. ★★★\u003c/strong\u003e\n\u003c/p\u003e\n\n## Install\n\nNPM: `npm install mobx-logger`\n \nCDN: `https://unpkg.com/mobx-logger/mobx-logger.umd.js` \n\n## Usage\n\n```js\nimport {enableLogging} from 'mobx-logger';\n\n// optional\nconst config = {...};\n\nenableLogging(config);\n```\n\n\u003e For Mobx 3 support please use Mobx Logger 0.6.0.\n\n## Options\n\nUnlike MobX DevTools you can simply configure which particular information should be logged to the console. Currently Actions, Reactions, Transactions and Computations are supported.\n\n```js\n{\n    predicate: () =\u003e true|false,\n    action: true|false,\n    reaction: true|false,\n    transaction: true|false,\n    compute: true|false\n}\n```\n\n## Logger Config\n\nYou 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.\n\nHere's an example of how to disable logging for all actions and computed properties for a given class:\n\n```js\nclass MyModel {\n    static mobxLoggerConfig: {\n        enabled: false\n    };\n    \n    // ...\n}\n```\n\nAlternatively you can disable logging for particular class methods:\n\n```js\nclass MyStore {\n    static mobxLoggerConfig: {\n        methods: {\n            myAction: false\n        }\n    };\n    \n    @action myAction() {\n        // calls to this method won't be logged\n    }\n}\n```\n\nYou can combine the above examples to whitelist certain actions for being logged:\n\n```js\nclass MyStore {\n    static mobxLoggerConfig: {\n        enabled: false,\n        methods: {\n            myAction: true\n        }\n    };\n    \n    @action myAction() {\n        // only calls to this method are being logged\n    }\n    \n    // other methods won't be logged ...\n}\n```\n\n\u003e Please keep in mind that at this point `mobxLoggerConfig` is only available for actions (`@action`) and computed properties (`@computed`).\n\n#### ReactNative\n\nFor ReactNative development use this predicate to only enable logging in dev mode with JS debugging enabled:\n\n```js\nenableLogging({\n    predicate: () =\u003e __DEV__ \u0026\u0026 Boolean(window.navigator.userAgent),\n    ...\n});\n```\n\n## License\n\nMIT\n","funding_links":["https://www.paypal.me/winterbe"],"categories":["Awesome MobX"],"sub_categories":["Related projects and utilities"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinterbe%2Fmobx-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwinterbe%2Fmobx-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinterbe%2Fmobx-logger/lists"}