Introduction

This document explains how to log into the js console.

Currently the js console does not exist, but will soon do : so starting logging is a good thing.

Base

The classes are org.ametys.log.LoggerManager and org.ametys.log.LoggerEntry.

You have to create a logger entry and add it to the logger manager this way

var entry = new org.ametys.log.LoggerEntry(org.ametys.log.LoggerEntry.LEVEL_DEBUG, "mylogcategory", new Date(), "mylogmessage", "mylogmessagedetails");
org.ametys.log.LoggerManager.getInstance().getEntries().push(entry);

See the API for more information.

Shortcuts

To log simply, use these

org.ametys.log.LoggerManager.debug(category, message, details)
org.ametys.log.LoggerManager.info(category, message, details)
org.ametys.log.LoggerManager.warning(category, message, details)
org.ametys.log.LoggerManager.error(category, message, details)
org.ametys.log.LoggerManager.fatalerror(category, message, details)
Back to top