From 0b663c91653bd865e15aed603377c0ec2523e189 Mon Sep 17 00:00:00 2001 From: caoxiaogang Date: Wed, 27 Aug 2025 16:05:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=BA=E5=87=BB=E6=8E=A5=E5=8F=A3=E9=87=8D?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: caoxiaogang --- api/@ohos.logLibrary.d.ts | 112 +++++++++++++++++++++++++++++++++++--- 1 file changed, 104 insertions(+), 8 deletions(-) diff --git a/api/@ohos.logLibrary.d.ts b/api/@ohos.logLibrary.d.ts index a3156537e7..3e2654681c 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 * -- Gitee