Skip to content

Commit e4ef935

Browse files
committed
feat: enhance Pushy logging with version info and update EventData interface
1 parent b336926 commit e4ef935

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/client.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
setLocalHashInfo,
2727
isFirstTime,
2828
isRolledBack,
29+
getCurrentVersionInfo,
2930
} from './core';
3031

3132
const SERVER_PRESETS = {
@@ -128,6 +129,7 @@ export class Pushy {
128129
log(type + ' ' + message);
129130
await this.loggerPromise.promise;
130131
const { logger = noop, appKey } = this.options;
132+
const info = await getCurrentVersionInfo();
131133
logger({
132134
type,
133135
data: {
@@ -137,6 +139,7 @@ export class Pushy {
137139
packageVersion,
138140
buildTime,
139141
message,
142+
...info,
140143
...data,
141144
},
142145
});

src/type.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ export interface EventData {
5454
message?: string;
5555
rolledBackVersion?: string;
5656
newVersion?: string;
57+
name?: string;
58+
description?: string;
59+
metaInfo?: string;
5760
[key: string]: any;
5861
}
5962

0 commit comments

Comments
 (0)