Logging API

Version 4 by Ken Fyten
on Mar 07, 2016 16:28.


compared with
Current by Ken Fyten
on Mar 07, 2016 16:30.


 
Key
These lines were removed. This word was removed.
These lines were added. This word was added.

View page history


There are 1 changes. View first change.

 h2. Logging API
  
 The Logging API is used to access the client console logger.
  
 The following Logging APIs are available:
  
  * h5. {{[ice.log.debug(logger, message, exception)|#debug]}}
 * h5. {{[ice.log.info(logger, message, exception)|#info]}}
 * h5. {{[ice.log.warn(logger, message, exception)|#warn]}}
 * h5. {{[ice.log.error(logger, message, exception)|#error]}}
 * h5. {{[ice.log.childLogger(parentLogger, categoryName)|#childLogger]}}
  * *{{[ice.log.debug(logger, message, exception)|#debug]}}*
 * *{{[ice.log.info(logger, message, exception)|#info]}}*
 * *{{[ice.log.warn(logger, message, exception)|#warn]}}*
 * *{{[ice.log.error(logger, message, exception)|#error]}}*
 * *{{[ice.log.childLogger(parentLogger, categoryName)|#childLogger]}}*
  
 ----
 \\
 {anchor:debug}
 {panel}
 h4. ice.log.debug(logger, message, exception)
  
 Logs a DEBUG level message to the console or log window.
  
 _Usage:_
  
 {code:javascript}ice.log.debug(ice.log, 'Debug message');{code}
 {_}Parameters:_
  
 * logger
 bq. The logger.
  
 * message
 bq. The message to be logged.
  
 {panel}
 \\
 {anchor:info}
 {panel}
 h4. ice.log.info(logger, message, exception)
  
 Logs a INFO level message to the console or log window.
  
 _Usage:_
  
 {code:javascript}ice.log.info(ice.log, 'Info message');{code}
 {_}Parameters:_
  
 * logger
 bq. The logger.
  
 * message
 bq. The message to be logged.
  
 {panel}
 \\
 {anchor:warn}
 {panel}
 h4. ice.log.warn(logger, message, exception)
  
 Logs a WARN level message to the console or log window.
  
 _Usage:_
  
 {code:javascript}ice.log.warn(ice.log, 'Warning message');{code}
 {_}Parameters:_
  
 * logger
 bq. The logger.
  
 * message
 bq. The message to be logged.
  
 {panel}
 \\
 {anchor:error}
 {panel}
 h4. ice.log.error(logger, message, exception)
  
 Logs a ERROR level message to the console or log window.
  
 _Usage:_
  
 {code:javascript}
 try {
  ...
 } catch (e) {
  ice.log.error(ice.log, 'Error occurred', e);
 }
 {code}
 {_}Parameters:_
  
 * logger
 bq. The logger.
  
 * message
 bq. The message to be logged.
  
 * responseDOM
 bq. The captured exception. This is an optional parameter.
  
 {panel}
 \\
 {anchor:childLogger}
 {panel}
 h4. ice.log.childLogger(parentLogger, categoryName)
  
 Creates an new child logger that logs its messages into the defined category.
  
 _Usage:_
  
 {code:javascript}var a = ice.log.childLogger(ice.log, 'A');
 ice.log.debug(a, 'message in category A');
 //outputs -- [window.A] debug: message in category A
  
 var aa = ice.log.childLogger(a, 'AA');
 ice.log.warn(aa, 'message in category AA');
  
 //outputs -- [window.A.AA] warning: message in category AA
 {code}
 {_}Parameters:_
  
 * logger
 bq. The parent logger.
  
 * categoryName
 bq. The name of the category.
 {panel}
 \\

© Copyright 2021 ICEsoft Technologies Canada Corp.