diff --git a/api/@ohos.logLibrary.d.ts b/api/@ohos.logLibrary.d.ts index a3156537e78a234a3dfd25403cafebfbdefdebd2..3e2654681caebe29868a3bf9dc76994f61672d86 100644 --- a/api/@ohos.logLibrary.d.ts +++ b/api/@ohos.logLibrary.d.ts @@ -108,8 +108,7 @@ declare namespace logLibrary { * @throws { BusinessError } 21300001 - Source file does not exists * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary * @systemapi - * @since arkts {'1.1':'10','1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function copy(logType: string, logName: string, dest: string): Promise; @@ -130,11 +129,60 @@ declare namespace logLibrary { * @throws { BusinessError } 21300001 - Source file does not exists * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary * @systemapi - * @since arkts {'1.1':'10','1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function copy(logType: string, logName: string, dest: string, callback: AsyncCallback): void; + /** + * @since 20 + * @arkts 1.2 + */ + overload copy { copyReturnPromise, copyWithCallback }; + + /** + * Copy log to dest path + * + * @permission ohos.permission.READ_HIVIEW_SYSTEM + * @param { string } logType - Log type + * @param { string } logName - Log name + * @param { string } dest - Log path under hiview sandbox of HAP + * @returns { Promise } Return Promise + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Permission denied, non-system app called system api + * @throws { BusinessError } 401 - Invalid argument. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + *
3. Parameter verification failed. + * @throws { BusinessError } 21300001 - Source file does not exists + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function copyReturnPromise(logType: string, logName: string, dest: string): Promise; + + /** + * Copy log to dest path + * + * @permission ohos.permission.READ_HIVIEW_SYSTEM + * @param { string } logType - Log type + * @param { string } logName - Log name + * @param { string } dest - Log path under hiview sandbox of HAP + * @param { AsyncCallback } callback - After finish copy log will callback + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Permission denied, non-system app called system api + * @throws { BusinessError } 401 - Invalid argument. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + *
3. Parameter verification failed. + * @throws { BusinessError } 21300001 - Source file does not exists + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function copyWithCallback(logType: string, logName: string, dest: string, callback: AsyncCallback): void; + /** * Move log to dest path * @@ -152,8 +200,7 @@ declare namespace logLibrary { * @throws { BusinessError } 21300001 - Source file does not exists * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary * @systemapi - * @since arkts {'1.1':'10','1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function move(logType: string, logName: string, dest: string): Promise; @@ -174,11 +221,60 @@ declare namespace logLibrary { * @throws { BusinessError } 21300001 - Source file does not exists * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary * @systemapi - * @since arkts {'1.1':'10','1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function move(logType: string, logName: string, dest: string, callback: AsyncCallback): void; + /** + * @since 20 + * @arkts 1.2 + */ + overload move { moveReturnPromise, moveWithCallback }; + + /** + * Move log to dest path + * + * @permission ohos.permission.WRITE_HIVIEW_SYSTEM + * @param { string } logType - Log type + * @param { string } logName - Log name + * @param { string } dest - Log path under hiview sandbox of HAP + * @returns { Promise } Return Promise + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Permission denied, non-system app called system api + * @throws { BusinessError } 401 - Invalid argument. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + *
3. Parameter verification failed. + * @throws { BusinessError } 21300001 - Source file does not exists + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function moveReturnPromise(logType: string, logName: string, dest: string): Promise; + + /** + * Move log to dest path + * + * @permission ohos.permission.WRITE_HIVIEW_SYSTEM + * @param { string } logType - Log type + * @param { string } logName - Log name + * @param { string } dest - Log path under hiview sandbox of HAP + * @param { AsyncCallback } callback - After finish move log will callback + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Permission denied, non-system app called system api + * @throws { BusinessError } 401 - Invalid argument. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + *
3. Parameter verification failed. + * @throws { BusinessError } 21300001 - Source file does not exists + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function moveWithCallback(logType: string, logName: string, dest: string, callback: AsyncCallback): void; + /** * Delete the log based on log name and log type *