hyper63 / hyper63/hyper-ext-model

feature: add `log` option

Aperta
#5 1 commento 0 reazioni 1 assegnatario Rivendicata da @twilson63 Vedi su GitHub
extension
Lingua principale
TypeScript
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.