From c39c8f03cc5460e682fe587ae464217ec1f7e0fc Mon Sep 17 00:00:00 2001 From: zhouhaifeng Date: Wed, 26 Apr 2023 15:33:09 +0800 Subject: [PATCH 01/10] add logLibrary to access log packages Signed-off-by: zhouhaifeng --- api/@ohos.logLibrary.d.ts | 142 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 api/@ohos.logLibrary.d.ts diff --git a/api/@ohos.logLibrary.d.ts b/api/@ohos.logLibrary.d.ts new file mode 100644 index 0000000000..6d75db1354 --- /dev/null +++ b/api/@ohos.logLibrary.d.ts @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from './basic'; +import { Callback } from './basic'; + +/** + * @since 10 + * @systemapi hide for inner use + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @import import loglibrary from '@ohos.logLibrary' + */ +declare namespace logLibrary { + /** + * log file entry + */ + interface LogEntry { + /** + * log file name + */ + name: string; + /** + * modify time, second from 1970-01-01 + */ + mtime: number; + /** + * log file size, byte + */ + size: number; + } + + /** + * List all log names of log type + * + * @since 10 + * @systemapi hide for inner use + * @permission ohos.permission.READ_HIVIEW_SYSTEM + * @param logType log type + * @throws {BusinessError} 201 - Permission denied + * @throws {BusinessError} 401 - Invalid argument + * @return {string[]} return string[] + */ + function listSync(logType: string): LogEntry[]; + + /** + * Copy log to dest path + * + * @since 10 + * @systemapi hide for inner use + * @permission ohos.permission.READ_HIVIEW_SYSTEM + * @param logType log type + * @param logName log name + * @param dest log path under hiview sandbox of HAP + * @throws {BusinessError} 201 - Permission denied + * @throws {BusinessError} 401 - Invalid argument + * @throws {BusinessError} 21300001 - source file does not exists + * @throws {BusinessError} 21300002 - no permission to write dest file + * @return {string[]} return string[] + */ + function copy(logType: string, logName: string, dest: string): Promise; + + /** + * Copy log to dest path + * + * @since 10 + * @systemapi hide for inner use + * @permission ohos.permission.READ_HIVIEW_SYSTEM + * @param logType log type + * @param logName log name + * @param dest log path under hiview sandbox of HAP + * @param callback after finish copy log will callback + * @throws {BusinessError} 201 - Permission denied + * @throws {BusinessError} 401 - Invalid argument + * @throws {BusinessError} 21300001 - source file does not exists + * @throws {BusinessError} 21300002 - no permission to write dest file + * @return {string[]} return string[] + */ + function copy(logType: string, logName: string, dest: string, callback: AsyncCallback): void; + + /** + * Move log to dest path + * + * @since 10 + * @systemapi hide for inner use + * @permission ohos.permission.WRITE_HIVIEW_SYSTEM + * @param logType log type + * @param logName log name + * @param dest log path under hiview sandbox of HAP + * @throws {BusinessError} 201 - Permission denied + * @throws {BusinessError} 401 - Invalid argument + * @throws {BusinessError} 21300001 - source file does not exists + * @throws {BusinessError} 21300002 - no permission to write dest file + * @return {string[]} return string[] + */ + function move(logType: string, logName: string, dest: string): Promise; + + /** + * Move log to dest path + * + * @since 10 + * @systemapi hide for inner use + * @permission ohos.permission.WRITE_HIVIEW_SYSTEM + * @param logType log type + * @param logName log name + * @param dest log path under hiview sandbox of HAP + * @param callback after finish move log will callback + * @throws {BusinessError} 201 - Permission denied + * @throws {BusinessError} 401 - Invalid argument + * @throws {BusinessError} 21300001 - source file does not exists + * @throws {BusinessError} 21300002 - no permission to write dest file + * @return {string[]} return string[] + */ + function move(logType: string, logName: string, dest: string, callback: AsyncCallback): void; + + /** + * Remove the log + * + * @since 10 + * @systemapi hide for inner use + * @permission ohos.permission.WRITE_HIVIEW_SYSTEM + * @param logType log type + * @param logName log name + * @throws {BusinessError} 201 - Permission denied + * @throws {BusinessError} 401 - Invalid argument + * @throws {BusinessError} 21300001 - source file does not exists + * @throws {BusinessError} 21300002 - no permission to write dest file + * @return {void} return void + */ + function removeSync(logType: string, logName: string): void; +} -- Gitee From 6a4ce27ea2d7da39665b419c40ea733ac747044d Mon Sep 17 00:00:00 2001 From: zhouhaifeng Date: Wed, 26 Apr 2023 16:12:42 +0800 Subject: [PATCH 02/10] fix the description of all api Signed-off-by: zhouhaifeng --- api/@ohos.logLibrary.d.ts | 152 ++++++++++++++++++++++---------------- 1 file changed, 88 insertions(+), 64 deletions(-) diff --git a/api/@ohos.logLibrary.d.ts b/api/@ohos.logLibrary.d.ts index 6d75db1354..dbce4a91b2 100644 --- a/api/@ohos.logLibrary.d.ts +++ b/api/@ohos.logLibrary.d.ts @@ -17,126 +17,150 @@ import { AsyncCallback } from './basic'; import { Callback } from './basic'; /** - * @since 10 - * @systemapi hide for inner use + * @namespace logLibrary * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary - * @import import loglibrary from '@ohos.logLibrary' + * @systemapi + * @since 10 */ declare namespace logLibrary { /** * log file entry + * + * @typedef LogEntry + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 10 */ interface LogEntry { /** * log file name + * + * @type { string } + * @since 10 */ name: string; + /** * modify time, second from 1970-01-01 + * + * @type { number } + * @since 10 */ mtime: number; + /** * log file size, byte + * + * @type { number } + * @since 10 */ size: number; } /** * List all log names of log type - * - * @since 10 - * @systemapi hide for inner use + * * @permission ohos.permission.READ_HIVIEW_SYSTEM - * @param logType log type - * @throws {BusinessError} 201 - Permission denied - * @throws {BusinessError} 401 - Invalid argument - * @return {string[]} return string[] + * @param { string } logType - log type + * @returns { LogEntry[] } return LogEntry[] + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 401 - Invalid argument + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 10 */ function listSync(logType: string): LogEntry[]; /** * Copy log to dest path - * - * @since 10 - * @systemapi hide for inner use + * * @permission ohos.permission.READ_HIVIEW_SYSTEM - * @param logType log type - * @param logName log name - * @param dest log path under hiview sandbox of HAP - * @throws {BusinessError} 201 - Permission denied - * @throws {BusinessError} 401 - Invalid argument - * @throws {BusinessError} 21300001 - source file does not exists - * @throws {BusinessError} 21300002 - no permission to write dest file - * @return {string[]} return string[] + * @param { string } logType - log type + * @param { string } logName - log name + * @param { string } dest - log path under hiview sandbox of HAP + * @returns { void } return void + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 401 - Invalid argument + * @throws { BusinessError } 21300001 - source file does not exists + * @throws { BusinessError } 21300002 - no permission to write dest file + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 10 */ function copy(logType: string, logName: string, dest: string): Promise; /** * Copy log to dest path - * - * @since 10 - * @systemapi hide for inner use + * * @permission ohos.permission.READ_HIVIEW_SYSTEM - * @param logType log type - * @param logName log name - * @param dest log path under hiview sandbox of HAP + * @param { string } logType - log type + * @param { string } logName - log name + * @param { string } dest - log path under hiview sandbox of HAP * @param callback after finish copy log will callback - * @throws {BusinessError} 201 - Permission denied - * @throws {BusinessError} 401 - Invalid argument - * @throws {BusinessError} 21300001 - source file does not exists - * @throws {BusinessError} 21300002 - no permission to write dest file - * @return {string[]} return string[] + * @returns { void } return void + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 401 - Invalid argument + * @throws { BusinessError } 21300001 - source file does not exists + * @throws { BusinessError } 21300002 - no permission to write dest file + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 10 */ function copy(logType: string, logName: string, dest: string, callback: AsyncCallback): void; /** * Move log to dest path - * - * @since 10 - * @systemapi hide for inner use + * * @permission ohos.permission.WRITE_HIVIEW_SYSTEM - * @param logType log type - * @param logName log name - * @param dest log path under hiview sandbox of HAP - * @throws {BusinessError} 201 - Permission denied - * @throws {BusinessError} 401 - Invalid argument - * @throws {BusinessError} 21300001 - source file does not exists - * @throws {BusinessError} 21300002 - no permission to write dest file - * @return {string[]} return string[] + * @param { string } logType - log type + * @param { string } logName - log name + * @param { string } dest - log path under hiview sandbox of HAP + * @returns { void } return void + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 401 - Invalid argument + * @throws { BusinessError } 21300001 - source file does not exists + * @throws { BusinessError } 21300002 - no permission to write dest file + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 10 */ function move(logType: string, logName: string, dest: string): Promise; /** * Move log to dest path - * - * @since 10 - * @systemapi hide for inner use + * * @permission ohos.permission.WRITE_HIVIEW_SYSTEM - * @param logType log type - * @param logName log name - * @param dest log path under hiview sandbox of HAP + * @param { string } logType - log type + * @param { string } logName - log name + * @param { string } dest - log path under hiview sandbox of HAP * @param callback after finish move log will callback - * @throws {BusinessError} 201 - Permission denied - * @throws {BusinessError} 401 - Invalid argument - * @throws {BusinessError} 21300001 - source file does not exists - * @throws {BusinessError} 21300002 - no permission to write dest file - * @return {string[]} return string[] + * @returns { void } return void + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 401 - Invalid argument + * @throws { BusinessError } 21300001 - source file does not exists + * @throws { BusinessError } 21300002 - no permission to write dest file + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 10 */ function move(logType: string, logName: string, dest: string, callback: AsyncCallback): void; /** * Remove the log - * - * @since 10 - * @systemapi hide for inner use + * * @permission ohos.permission.WRITE_HIVIEW_SYSTEM - * @param logType log type - * @param logName log name - * @throws {BusinessError} 201 - Permission denied - * @throws {BusinessError} 401 - Invalid argument - * @throws {BusinessError} 21300001 - source file does not exists - * @throws {BusinessError} 21300002 - no permission to write dest file - * @return {void} return void + * @param { string } logType - log type + * @param { string } logName - log name + * @returns { void } return void + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 401 - Invalid argument + * @throws { BusinessError } 21300001 - source file does not exists + * @throws { BusinessError } 21300002 - no permission to write dest file + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 10 */ function removeSync(logType: string, logName: string): void; } + +export default logLibrary; \ No newline at end of file -- Gitee From 23e08b27e597491d1f5bb8affe72794985c364e2 Mon Sep 17 00:00:00 2001 From: zhouhaifeng Date: Thu, 27 Apr 2023 20:15:11 +0800 Subject: [PATCH 03/10] remove no use import Signed-off-by: zhouhaifeng --- api/@ohos.logLibrary.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/api/@ohos.logLibrary.d.ts b/api/@ohos.logLibrary.d.ts index dbce4a91b2..0167dfed1b 100644 --- a/api/@ohos.logLibrary.d.ts +++ b/api/@ohos.logLibrary.d.ts @@ -14,7 +14,6 @@ */ import { AsyncCallback } from './basic'; -import { Callback } from './basic'; /** * @namespace logLibrary -- Gitee From fcff5ef1134b5c8a82529d3905ad0ededbb61d21 Mon Sep 17 00:00:00 2001 From: zhouhaifeng Date: Fri, 5 May 2023 17:01:44 +0800 Subject: [PATCH 04/10] add data type of callback Signed-off-by: zhouhaifeng --- api/@ohos.logLibrary.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.logLibrary.d.ts b/api/@ohos.logLibrary.d.ts index 0167dfed1b..40b735b3dd 100644 --- a/api/@ohos.logLibrary.d.ts +++ b/api/@ohos.logLibrary.d.ts @@ -95,7 +95,7 @@ declare namespace logLibrary { * @param { string } logType - log type * @param { string } logName - log name * @param { string } dest - log path under hiview sandbox of HAP - * @param callback after finish copy log will callback + * @param { AsyncCallback} callback - after finish copy log will callback * @returns { void } return void * @throws { BusinessError } 201 - Permission denied * @throws { BusinessError } 401 - Invalid argument @@ -132,7 +132,7 @@ declare namespace logLibrary { * @param { string } logType - log type * @param { string } logName - log name * @param { string } dest - log path under hiview sandbox of HAP - * @param callback after finish move log will callback + * @param {AsyncCallback} callback - after finish move log will callback * @returns { void } return void * @throws { BusinessError } 201 - Permission denied * @throws { BusinessError } 401 - Invalid argument -- Gitee From 380fa3e0f6a9ece48d30ade7450b815a175c4a6d Mon Sep 17 00:00:00 2001 From: zhouhaifeng Date: Fri, 5 May 2023 17:07:15 +0800 Subject: [PATCH 05/10] remove no used info Signed-off-by: zhouhaifeng --- api/@ohos.logLibrary.d.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/api/@ohos.logLibrary.d.ts b/api/@ohos.logLibrary.d.ts index 40b735b3dd..d433d3421c 100644 --- a/api/@ohos.logLibrary.d.ts +++ b/api/@ohos.logLibrary.d.ts @@ -81,7 +81,6 @@ declare namespace logLibrary { * @throws { BusinessError } 201 - Permission denied * @throws { BusinessError } 401 - Invalid argument * @throws { BusinessError } 21300001 - source file does not exists - * @throws { BusinessError } 21300002 - no permission to write dest file * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary * @systemapi * @since 10 @@ -100,7 +99,6 @@ declare namespace logLibrary { * @throws { BusinessError } 201 - Permission denied * @throws { BusinessError } 401 - Invalid argument * @throws { BusinessError } 21300001 - source file does not exists - * @throws { BusinessError } 21300002 - no permission to write dest file * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary * @systemapi * @since 10 @@ -118,7 +116,6 @@ declare namespace logLibrary { * @throws { BusinessError } 201 - Permission denied * @throws { BusinessError } 401 - Invalid argument * @throws { BusinessError } 21300001 - source file does not exists - * @throws { BusinessError } 21300002 - no permission to write dest file * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary * @systemapi * @since 10 @@ -137,7 +134,6 @@ declare namespace logLibrary { * @throws { BusinessError } 201 - Permission denied * @throws { BusinessError } 401 - Invalid argument * @throws { BusinessError } 21300001 - source file does not exists - * @throws { BusinessError } 21300002 - no permission to write dest file * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary * @systemapi * @since 10 @@ -154,7 +150,6 @@ declare namespace logLibrary { * @throws { BusinessError } 201 - Permission denied * @throws { BusinessError } 401 - Invalid argument * @throws { BusinessError } 21300001 - source file does not exists - * @throws { BusinessError } 21300002 - no permission to write dest file * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary * @systemapi * @since 10 -- Gitee From 6004aa4d6ac4e7b85bd2ce51dc930ed15bc29319 Mon Sep 17 00:00:00 2001 From: zhouhaifeng Date: Sat, 6 May 2023 17:21:21 +0800 Subject: [PATCH 06/10] change four space to two space Signed-off-by: zhouhaifeng --- api/@ohos.logLibrary.d.ts | 230 +++++++++++++++++++------------------- 1 file changed, 115 insertions(+), 115 deletions(-) diff --git a/api/@ohos.logLibrary.d.ts b/api/@ohos.logLibrary.d.ts index d433d3421c..e0aa51b335 100644 --- a/api/@ohos.logLibrary.d.ts +++ b/api/@ohos.logLibrary.d.ts @@ -22,139 +22,139 @@ import { AsyncCallback } from './basic'; * @since 10 */ declare namespace logLibrary { + /** + * log file entry + * + * @typedef LogEntry + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 10 + */ + interface LogEntry { /** - * log file entry + * log file name * - * @typedef LogEntry - * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary - * @systemapi + * @type { string } * @since 10 */ - interface LogEntry { - /** - * log file name - * - * @type { string } - * @since 10 - */ - name: string; - - /** - * modify time, second from 1970-01-01 - * - * @type { number } - * @since 10 - */ - mtime: number; - - /** - * log file size, byte - * - * @type { number } - * @since 10 - */ - size: number; - } + name: string; /** - * List all log names of log type + * modify time, second from 1970-01-01 * - * @permission ohos.permission.READ_HIVIEW_SYSTEM - * @param { string } logType - log type - * @returns { LogEntry[] } return LogEntry[] - * @throws { BusinessError } 201 - Permission denied - * @throws { BusinessError } 401 - Invalid argument - * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary - * @systemapi + * @type { number } * @since 10 */ - function listSync(logType: string): LogEntry[]; + mtime: number; /** - * Copy log to dest path + * log file size, byte * - * @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 { void } return void - * @throws { BusinessError } 201 - Permission denied - * @throws { BusinessError } 401 - Invalid argument - * @throws { BusinessError } 21300001 - source file does not exists - * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary - * @systemapi + * @type { number } * @since 10 */ - function copy(logType: string, logName: string, dest: string): Promise; + size: number; + } - /** - * 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 - * @returns { void } return void - * @throws { BusinessError } 201 - Permission denied - * @throws { BusinessError } 401 - Invalid argument - * @throws { BusinessError } 21300001 - source file does not exists - * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary - * @systemapi - * @since 10 - */ - function copy(logType: string, logName: string, dest: string, callback: AsyncCallback): void; + /** + * List all log names of log type + * + * @permission ohos.permission.READ_HIVIEW_SYSTEM + * @param { string } logType - log type + * @returns { LogEntry[] } return LogEntry[] + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 401 - Invalid argument + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 10 + */ + function listSync(logType: string): LogEntry[]; - /** - * 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 { void } return void - * @throws { BusinessError } 201 - Permission denied - * @throws { BusinessError } 401 - Invalid argument - * @throws { BusinessError } 21300001 - source file does not exists - * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary - * @systemapi - * @since 10 - */ - function move(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 + * @returns { void } return void + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 401 - Invalid argument + * @throws { BusinessError } 21300001 - source file does not exists + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 10 + */ + function copy(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 - * @returns { void } return void - * @throws { BusinessError } 201 - Permission denied - * @throws { BusinessError } 401 - Invalid argument - * @throws { BusinessError } 21300001 - source file does not exists - * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary - * @systemapi - * @since 10 - */ - function move(logType: string, logName: string, dest: string, callback: AsyncCallback): void; + /** + * 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 + * @returns { void } return void + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 401 - Invalid argument + * @throws { BusinessError } 21300001 - source file does not exists + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 10 + */ + function copy(logType: string, logName: string, dest: string, callback: AsyncCallback): void; - /** - * Remove the log - * - * @permission ohos.permission.WRITE_HIVIEW_SYSTEM - * @param { string } logType - log type - * @param { string } logName - log name - * @returns { void } return void - * @throws { BusinessError } 201 - Permission denied - * @throws { BusinessError } 401 - Invalid argument - * @throws { BusinessError } 21300001 - source file does not exists - * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary - * @systemapi - * @since 10 - */ - function removeSync(logType: string, logName: string): void; + /** + * 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 { void } return void + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 401 - Invalid argument + * @throws { BusinessError } 21300001 - source file does not exists + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 10 + */ + function move(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 + * @returns { void } return void + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 401 - Invalid argument + * @throws { BusinessError } 21300001 - source file does not exists + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 10 + */ + function move(logType: string, logName: string, dest: string, callback: AsyncCallback): void; + + /** + * Remove the log + * + * @permission ohos.permission.WRITE_HIVIEW_SYSTEM + * @param { string } logType - log type + * @param { string } logName - log name + * @returns { void } return void + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 401 - Invalid argument + * @throws { BusinessError } 21300001 - source file does not exists + * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary + * @systemapi + * @since 10 + */ + function removeSync(logType: string, logName: string): void; } export default logLibrary; \ No newline at end of file -- Gitee From 1a3b3419fd56e0e1f1bdc1f55cf57f8338fcab60 Mon Sep 17 00:00:00 2001 From: zhouhaifeng Date: Sat, 6 May 2023 17:28:36 +0800 Subject: [PATCH 07/10] correct the import syntax Signed-off-by: zhouhaifeng --- api/@ohos.logLibrary.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.logLibrary.d.ts b/api/@ohos.logLibrary.d.ts index e0aa51b335..8d10e9f3e2 100644 --- a/api/@ohos.logLibrary.d.ts +++ b/api/@ohos.logLibrary.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import type { AsyncCallback } from './@ohos.base'; /** * @namespace logLibrary -- Gitee From 687f6bfc32706cc81583348594a008f76a391c99 Mon Sep 17 00:00:00 2001 From: zhouhaifeng Date: Tue, 9 May 2023 10:01:04 +0800 Subject: [PATCH 08/10] fix the comment message of api Signed-off-by: zhouhaifeng --- api/@ohos.logLibrary.d.ts | 64 +++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/api/@ohos.logLibrary.d.ts b/api/@ohos.logLibrary.d.ts index 8d10e9f3e2..2376d27c91 100644 --- a/api/@ohos.logLibrary.d.ts +++ b/api/@ohos.logLibrary.d.ts @@ -23,7 +23,7 @@ import type { AsyncCallback } from './@ohos.base'; */ declare namespace logLibrary { /** - * log file entry + * Log file entry * * @typedef LogEntry * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary @@ -32,7 +32,7 @@ declare namespace logLibrary { */ interface LogEntry { /** - * log file name + * Log file name * * @type { string } * @since 10 @@ -40,7 +40,7 @@ declare namespace logLibrary { name: string; /** - * modify time, second from 1970-01-01 + * File modification time, expressed by the number of seconds elapsed from 1970-01-01 * * @type { number } * @since 10 @@ -48,7 +48,7 @@ declare namespace logLibrary { mtime: number; /** - * log file size, byte + * Log file size, byte * * @type { number } * @since 10 @@ -60,8 +60,8 @@ declare namespace logLibrary { * List all log names of log type * * @permission ohos.permission.READ_HIVIEW_SYSTEM - * @param { string } logType - log type - * @returns { LogEntry[] } return LogEntry[] + * @param { string } logType - Log type + * @returns { LogEntry[] } Return LogEntry[] * @throws { BusinessError } 201 - Permission denied * @throws { BusinessError } 401 - Invalid argument * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary @@ -74,13 +74,13 @@ declare namespace logLibrary { * 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 { void } return void + * @param { string } logType - Log type + * @param { string } logName - Log name + * @param { string } dest - Log path under hiview sandbox of HAP + * @returns { void } Return void * @throws { BusinessError } 201 - Permission denied * @throws { BusinessError } 401 - Invalid argument - * @throws { BusinessError } 21300001 - source file does not exists + * @throws { BusinessError } 21300001 - Source file does not exists * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary * @systemapi * @since 10 @@ -91,14 +91,14 @@ declare namespace logLibrary { * 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 - * @returns { void } return void + * @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 + * @returns { void } Return void * @throws { BusinessError } 201 - Permission denied * @throws { BusinessError } 401 - Invalid argument - * @throws { BusinessError } 21300001 - source file does not exists + * @throws { BusinessError } 21300001 - Source file does not exists * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary * @systemapi * @since 10 @@ -109,13 +109,13 @@ declare namespace logLibrary { * 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 { void } return void + * @param { string } logType - Log type + * @param { string } logName - Log name + * @param { string } dest - Log path under hiview sandbox of HAP + * @returns { void } Return void * @throws { BusinessError } 201 - Permission denied * @throws { BusinessError } 401 - Invalid argument - * @throws { BusinessError } 21300001 - source file does not exists + * @throws { BusinessError } 21300001 - Source file does not exists * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary * @systemapi * @since 10 @@ -126,14 +126,14 @@ declare namespace logLibrary { * 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 - * @returns { void } return void + * @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 + * @returns { void } Return void * @throws { BusinessError } 201 - Permission denied * @throws { BusinessError } 401 - Invalid argument - * @throws { BusinessError } 21300001 - source file does not exists + * @throws { BusinessError } 21300001 - Source file does not exists * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary * @systemapi * @since 10 @@ -144,12 +144,12 @@ declare namespace logLibrary { * Remove the log * * @permission ohos.permission.WRITE_HIVIEW_SYSTEM - * @param { string } logType - log type - * @param { string } logName - log name - * @returns { void } return void + * @param { string } logType - Log type + * @param { string } logName - Log name + * @returns { void } Return void * @throws { BusinessError } 201 - Permission denied * @throws { BusinessError } 401 - Invalid argument - * @throws { BusinessError } 21300001 - source file does not exists + * @throws { BusinessError } 21300001 - Source file does not exists * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary * @systemapi * @since 10 -- Gitee From 91573a9b3cc46d1a755ab695c06cebeea1a0ba11 Mon Sep 17 00:00:00 2001 From: zhouhaifeng Date: Fri, 12 May 2023 11:05:42 +0800 Subject: [PATCH 09/10] fix the removeSync comment Signed-off-by: zhouhaifeng --- api/@ohos.logLibrary.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.logLibrary.d.ts b/api/@ohos.logLibrary.d.ts index 2376d27c91..c8db7e57eb 100644 --- a/api/@ohos.logLibrary.d.ts +++ b/api/@ohos.logLibrary.d.ts @@ -141,7 +141,7 @@ declare namespace logLibrary { function move(logType: string, logName: string, dest: string, callback: AsyncCallback): void; /** - * Remove the log + * Delete the log based on log name and log type * * @permission ohos.permission.WRITE_HIVIEW_SYSTEM * @param { string } logType - Log type -- Gitee From 28064097c3b50179ca3e2024bf4060b42a3b2f89 Mon Sep 17 00:00:00 2001 From: zhouhaifeng Date: Fri, 19 May 2023 10:21:34 +0800 Subject: [PATCH 10/10] add error code 202 and remove sync Signed-off-by: zhouhaifeng --- api/@ohos.logLibrary.d.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/api/@ohos.logLibrary.d.ts b/api/@ohos.logLibrary.d.ts index c8db7e57eb..f74f8c4e7a 100644 --- a/api/@ohos.logLibrary.d.ts +++ b/api/@ohos.logLibrary.d.ts @@ -63,12 +63,13 @@ declare namespace logLibrary { * @param { string } logType - Log type * @returns { LogEntry[] } Return LogEntry[] * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Permission denied, non-system app called system api * @throws { BusinessError } 401 - Invalid argument * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary * @systemapi * @since 10 */ - function listSync(logType: string): LogEntry[]; + function list(logType: string): LogEntry[]; /** * Copy log to dest path @@ -79,6 +80,7 @@ declare namespace logLibrary { * @param { string } dest - Log path under hiview sandbox of HAP * @returns { void } Return void * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Permission denied, non-system app called system api * @throws { BusinessError } 401 - Invalid argument * @throws { BusinessError } 21300001 - Source file does not exists * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary @@ -97,6 +99,7 @@ declare namespace logLibrary { * @param { AsyncCallback} callback - After finish copy log will callback * @returns { void } Return void * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Permission denied, non-system app called system api * @throws { BusinessError } 401 - Invalid argument * @throws { BusinessError } 21300001 - Source file does not exists * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary @@ -114,6 +117,7 @@ declare namespace logLibrary { * @param { string } dest - Log path under hiview sandbox of HAP * @returns { void } Return void * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Permission denied, non-system app called system api * @throws { BusinessError } 401 - Invalid argument * @throws { BusinessError } 21300001 - Source file does not exists * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary @@ -132,6 +136,7 @@ declare namespace logLibrary { * @param {AsyncCallback} callback - After finish move log will callback * @returns { void } Return void * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Permission denied, non-system app called system api * @throws { BusinessError } 401 - Invalid argument * @throws { BusinessError } 21300001 - Source file does not exists * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary @@ -148,13 +153,14 @@ declare namespace logLibrary { * @param { string } logName - Log name * @returns { void } Return void * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Permission denied, non-system app called system api * @throws { BusinessError } 401 - Invalid argument * @throws { BusinessError } 21300001 - Source file does not exists * @syscap SystemCapability.HiviewDFX.Hiview.LogLibrary * @systemapi * @since 10 */ - function removeSync(logType: string, logName: string): void; + function remove(logType: string, logName: string): void; } export default logLibrary; \ No newline at end of file -- Gitee