CrxOop CrxOop: Bringing Object Oriented Programming, and Proper Prototype Based Programming, To Javascript
The aim of the library documented below is to provide developers with a solution to allow development using interfaces and classes as they are known in other object oriented programming (OOP) languages such as C++, C#, Java and PHP. Further more, V1.4 introduces structures, a generalization of the concept of prototypal inheritance, known here as POBP.
Subject
Body*
Email
SUBMIT CLOSE
Menu

2.1 crxOop.setLogger()

CrxOop provides the global function crxOop.setLogger which can be used to route the error messages elsewhere. The function itself does not throw exceptions. By default, messages are sent to the console if the browser supports it. The function must be called before any class registration or interface registration. If called later, the call will fail. If unsure, make the call right after the inclusion line of the library in your html code.

crxOop.setLogger(LoggingFunction)
LoggingFunction
Function
A function that takes in a two parameters. The first parameter, a string, contains the error message. The second parameter, a number, contains 0 if a fatal error, or 1 if a warning.
Return
Boolean
true on success, and false on failure.
Example
crxOop.setLogger(function(pMessage, pErrorType)
{
   if(pErrorType === 0)
      {console.log("Fatal Error: " + pMessage);}
   else if(pErrorType === 1)
      {console.log("Warning: " + pMessage);}

   return;
});