This repository was archived by the owner on Apr 8, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 1
- export class MockStdOut {
1
+ import { ZBCustomLogger } from './interfaces'
2
+ export class MockStdOut implements ZBCustomLogger {
2
3
public messages : string [ ] = [ ]
3
4
4
5
public info ( message : string ) {
Original file line number Diff line number Diff line change @@ -7,6 +7,15 @@ export interface BasicAuthConfig {
7
7
password : string
8
8
username : string
9
9
}
10
+ // The JSON-stringified version of this is sent to the ZBCustomLogger
11
+ export interface ZBLogMessage {
12
+ timestamp : Date
13
+ context : string
14
+ id : string
15
+ level : Loglevel
16
+ message : string
17
+ time : string
18
+ }
10
19
11
20
export interface KeyedObject {
12
21
[ key : string ] : any
@@ -451,10 +460,21 @@ export interface CamundaCloudConfig {
451
460
cacheOnDisk ?: boolean
452
461
}
453
462
463
+ export interface ZBCustomLogger {
464
+ /**
465
+ * Receives a JSON-stringified ZBLogMessage
466
+ */
467
+ info : ( message : string ) => void
468
+ /**
469
+ * Receives a JSON-stringified ZBLogMessage
470
+ */
471
+ error : ( message : string ) => void
472
+ }
473
+
454
474
export interface ZBClientOptions {
455
475
connectionTolerance ?: number
456
476
loglevel ?: Loglevel
457
- stdout ?: any
477
+ stdout ?: ZBCustomLogger
458
478
retry ?: boolean
459
479
maxRetries ?: number
460
480
maxRetryTimeout ?: number
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export class ZBClient extends EventEmitter {
47
47
private oAuth ?: OAuthProvider
48
48
private basicAuth ?: ZB . BasicAuthConfig
49
49
private useTLS : boolean
50
- private stdout : any
50
+ private stdout : ZB . ZBCustomLogger
51
51
private lastReady ?: Date
52
52
private lastConnectionError ?: Date
53
53
You can’t perform that action at this time.
0 commit comments