This sample shows how to use log APIs to print log information and save the information to the application installation directory.
import logger from '@ohos/log'
import { LogLevel } from '@ohos/log'
import { Configure } from '@ohos/log'
Configure = {
cheese: {
types: string[],
filename: string
}
defaults: {
appenders: string,
level: LogLevel
}
}
// If types is set to file, logs are saved to the file named by filename. appenders indicates the log tag, and level indicates the lowest log level.
logger.setConfigure(configure: Configure)
// configure indicates the parameter configuration.
logger.debug(value)
// value indicates the log content.
logger.info(value)
// value indicates the log content.
logger.warn(value)
// value indicates the log content.
logger.error(value)
// value indicates the log content.
logger.fatal(value, bool)
// value indicates the log content.
This sample requires API version 9 or later.
This sample requires DevEco Studio 3.1 Canary1 (Build Version: 3.1.0.100) to compile and run.
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Комментарий ( 0 )