| Package: | CQ |
| Class: | Log |
| Extends: | Object |
| Clientlib: | cq.widgets |
A facility to write log messages to the console.
Use the variable window.CQ_initial_log_level to set the
initial log level.
Supported log levels:
| Method | Defined By | |
|---|---|---|
debug( String message, [String/String[] snippets] ) : void
|
Log | |
error( String message, [String/String[] snippets] ) : void
|
Log | |
fatal( String message, [String/String[] snippets] ) : void
|
Log | |
info( String message, [String/String[] snippets] ) : void
|
Log | |
setLevel( Number level ) : void <static> Sets the log level.
Supported log levels:
CQ.Log.OFF (default)
CQ.Log.FATAL
CQ.Log.ERROR
CQ.Log.WARN
...
<static> Sets the log level.
Supported log levels:
Parameters:
|
Log | |
trace( String message, [String/String[] snippets] ) : void
|
Log | |
traceMethodCalls( Object/String obj, [String xtype], [Boolean onlyOwnMethods], [Function loggerFunc] ) : void <static> Logs all calls to the functions of the given object. For intercepting the
constructor as well, one has...
<static> Logs all calls to the functions of the given object. For intercepting the
constructor as well, one has to pass the type as string plus the according xtype.
Note: Use only for debugging! Depends on ExtJs's Function.createInterceptor method. Examples: // normal object instance; use second param for object name in log message
CQ.Log.traceMethodCalls(myObject, "MyObject");
// intercept all instances of an Ext-style object/component, even constructors
CQ.Log.traceMethodCalls("CQ.Dialog", "dialog");
// same as before, but only log methods directly defined on CQ.Dialog (not any inherited)
CQ.Log.traceMethodCalls("CQ.Dialog", "dialog", true);
// same as before, but provide a custom log function for custom log target or formatting
CQ.Log.traceMethodCalls("CQ.Dialog", "dialog", true, function(objName, methodName, argList, args) {
// btw, this is the default logging call if 'loggerFunc' is not set
console.log(">> " + objName + "." + name + "(" + argList + ")");
});
Note calling this twice for the same object/class will basically work, but the "onlyOwnMethods" parameter will no longer be properly respected.
Parameters:
|
Log | |
warn( String message, [String/String[] snippets] ) : void
|
Log | |