hyper63 / hyper63/hyper-ext-model

feature: add `log` option

Open
#5 1 comment 0 reactions 1 assignee Claimed by @twilson63 View on GitHub
extension
Dominant language
TypeScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

trigger a `HYPER-LOG` event with a log message object - then the parent application can add and event listener to the `HYPER-LOG` event and choose how to distribute the log message.

```js
const profiles = hyper.ext.model({ name: 'profile', log: true })
```

This feature adds logging to the model service, when a user performs any action in the model and this flag is enabled then
the model will console log:

```
{ "type": "INFO|DEBUG|ERROR", "action": "UPSERT", "params": ["1", {...}], "date": "...", "ok": true }
```

- [ ] upsert
- [ ] get
- [ ] remove
- [ ] query
- [ ] sync
- [ ] count
- [ ] search
- [ ] addAttachment
- [ ] getAttachment
- [ ] removeAttachment

### Modes

- atomic : auto rollback all updates if any service returns an error
- non-atomic : don't rollback and report services that failied

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.