mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-16 08:41:37 +08:00
feat: enhance Pushy logging with version info and update EventData interface
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
|||||||
setLocalHashInfo,
|
setLocalHashInfo,
|
||||||
isFirstTime,
|
isFirstTime,
|
||||||
isRolledBack,
|
isRolledBack,
|
||||||
|
getCurrentVersionInfo,
|
||||||
} from './core';
|
} from './core';
|
||||||
|
|
||||||
const SERVER_PRESETS = {
|
const SERVER_PRESETS = {
|
||||||
@@ -128,6 +129,7 @@ export class Pushy {
|
|||||||
log(type + ' ' + message);
|
log(type + ' ' + message);
|
||||||
await this.loggerPromise.promise;
|
await this.loggerPromise.promise;
|
||||||
const { logger = noop, appKey } = this.options;
|
const { logger = noop, appKey } = this.options;
|
||||||
|
const info = await getCurrentVersionInfo();
|
||||||
logger({
|
logger({
|
||||||
type,
|
type,
|
||||||
data: {
|
data: {
|
||||||
@@ -137,6 +139,7 @@ export class Pushy {
|
|||||||
packageVersion,
|
packageVersion,
|
||||||
buildTime,
|
buildTime,
|
||||||
message,
|
message,
|
||||||
|
...info,
|
||||||
...data,
|
...data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@@ -54,6 +54,9 @@ export interface EventData {
|
|||||||
message?: string;
|
message?: string;
|
||||||
rolledBackVersion?: string;
|
rolledBackVersion?: string;
|
||||||
newVersion?: string;
|
newVersion?: string;
|
||||||
|
name?: string;
|
||||||
|
description?: string;
|
||||||
|
metaInfo?: string;
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user