Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface ILogger

interface ILogger
Extends IStandard Core Hierarchical logger interface. The process object implements this interface, and component-specific logger objects can also implement this interface. The logger will be created with a dot separated name. Ex:

Methods

log()

void log(LogLevel level, string message, IError? associatedError)
Emit a log message.

Parameters

level
LogLevel — Required severity level
message
string — Required log message
associatedError
IError? — Optional if present, error objects that caused this log message. Formatting is implementation specific.

isEnabled()

bool isEnabled(LogLevel level)
Check if this severity level is enabled.

Parameters

level
LogLevel — Required Severity level

Returns

bool whether logging is enabled for this level

getChild()

ILogger* getChild(string suffix)
Get a sub-logger from this logger. Hierarchical loggers are organized in a dot separated manner, much like Python or Java modules are organized. The name has to adhere to the same lexical structure as APMF2 package name. This method is designed for creating component-specific loggers based on the global process object logger. These components then log their messages to their respective loggers. For instance, a graphics library could establish its own dedicated logger derived from the global logger. The method is also idempotent, calling it multiple times will yield the same object.

Parameters

suffix
string — Required logging namespace suffix

Returns

ILogger* new logger instance
Last modified on October 29, 2026