[ADF-2477] message bus in log service (#3063)

* add message bus in log service to allow third pat integrations

* fix test after review
This commit is contained in:
Eugenio Romano
2018-03-13 15:48:19 +00:00
committed by GitHub
parent 6c56d164ec
commit 27de866193
3 changed files with 96 additions and 43 deletions

View File

@@ -53,4 +53,36 @@ If you want set for example the log to warning:
{
"logLevel": "WARN"
}
```
```
### Log message bus
The logservice provide also an Observable ***onMessage*** where you can subscribe and recive all the logs:
The messagge object recived form the bus is composed:
```ts
{
text: "Message log text"
type: "ERROR|DEBUG|INFO|LOG|TRACE|WARN|ASSERT"
}
```
## Usage
```ts
import { LogService } from '@alfresco/adf-core';
@Component({...})
export class AppComponent {
constructor(logService: LogService, myIntegrationService: MyIntegrationService)) {
logService.onMessage.subscribe((message) => {
myIntegrationService.send(message.text,message.type);
});
}
}
```