AlogRecord

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

√

Atlas inference products

√

Atlas training products

√

Function

This API will be deprecated in later versions. To avoid compatibility issues, you are advised not to use it.

Records logs generated by each module.

Prototype

1
void AlogRecord(uint32_t moduleId, uint32_t logType, int32_t level, const char *fmt, ...)

Parameters

Parameter

Input/Output

Description

moduleId

Input

Module ID. For details about the enumerated values, see Definitions of Data Types.

logType

Input

Type of the log. For details about the enumerated values, see Definitions of Data Types. If other values are passed, the log is regarded as a debug log.

level

Input

Level of the log. For details about the macro definition, see Definitions of Data Types.

NOTE:

Debug-level run logs will not be recorded. DLOG_TYPE_RUN and DLOG_DEBUG cannot be used together.

fmt

Input

Information to be printed.

  • The API does not verify the content validity.
  • The maximum length of a single log is 1024 bytes. If the length exceeds 1024 bytes, the log will be truncated.

Returns

None

Example

AlogRecord(SLOG, DLOG_TYPE_RUN, DLOG_INFO, "test run log");