mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[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:
@@ -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);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
Reference in New Issue
Block a user