tag:robotlegs.tenderapp.com,2009-10-18:/discussions/robotlegs-2/9117-how-to-disable-loggerRobotlegs: Discussion 2014-01-12T14:57:51Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/309992662014-01-09T10:10:44Z2014-01-09T10:10:44ZHow to disable Logger?<div><p>Hi,</p>
<p>To disable the logger, you need to create a custom MVCSBundle
like this:</p>
<pre>
<code>public class CustomMVCSBundle implements IBundle
{
public function extend(context:IContext):void
{
//context.logLevel = LogLevel.DEBUG;
context.logLevel = 0;
context.install(
TraceLoggingExtension,
VigilanceExtension,
InjectableLoggerExtension,
ContextViewExtension,
EventDispatcherExtension,
ModularityExtension,
DirectCommandMapExtension,
EventCommandMapExtension,
LocalEventMapExtension,
ViewManagerExtension,
StageObserverExtension,
MediatorMapExtension,
ViewProcessorMapExtension,
StageCrawlerExtension,
StageSyncExtension);
context.configure(ContextViewListenerConfig);
}
}</code>
</pre>
<p>and use it like this:</p>
<pre>
<code>context = new Context()
.install(CustomMVCSBundle)
.configure(new ContextView(this));</code>
</pre>
<p>In your CustomMVCSBundle, you either comment out
context.logLevel = LogLevel.DEBUG; or set it to 0, like in the
example above, or you don't install the TraceLoggingExtension.</p>
<p>So, if you'd have a Bundle like this one:</p>
<pre>
<code>public class CustomMVCSBundle implements IBundle
{
public function extend(context:IContext):void
{
context.install(
TraceLoggingExtension,
VigilanceExtension,
InjectableLoggerExtension,
ContextViewExtension,
EventDispatcherExtension,
ModularityExtension,
DirectCommandMapExtension,
EventCommandMapExtension,
LocalEventMapExtension,
ViewManagerExtension,
StageObserverExtension,
MediatorMapExtension,
ViewProcessorMapExtension,
StageCrawlerExtension,
StageSyncExtension);
context.configure(ContextViewListenerConfig);
}
}</code>
</pre>
<p>then you can control the logger by setting it to whatever you
need it to be:</p>
<pre>
<code>context = new Context()
context.install(CustomMVCSBundle)
//context.logLevel = 0;
//context.logLevel = LogLevel.INFO;
context.logLevel = LogLevel.DEBUG;
context .configure(new ContextView(this));</code>
</pre>
<p>I hope that helps.<br>
Ondina</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/309992662014-01-09T10:27:28Z2014-01-12T14:57:51ZHow to disable Logger?<div><p>uff, thanks</p></div>transglobalstag:robotlegs.tenderapp.com,2009-10-18:Comment/309992662014-01-09T11:12:44Z2014-01-09T11:12:44ZHow to disable Logger?<div><p>no problem</p></div>Ondina D.F.