tag:robotlegs.tenderapp.com,2009-10-18:/discussions/robotlegs-2/3964-cant-change-mvcs-bundle-defaults-loglevelRobotlegs: Discussion 2013-07-26T10:58:22Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/278353442013-07-18T06:41:09Z2013-07-18T06:41:09ZCan't change MVCS bundle defaults logLevel<div><p>Hi guys</p>
<p>I did search for "logLevel" but nothing return so i should
ask.<br>
Question is how can i turn if off?<br>
refer to<br>
<a href=
"https://github.com/robotlegs/robotlegs-framework/blob/master/src/robotlegs/bender/framework/readme-logging.md">
https://github.com/robotlegs/robotlegs-framework/blob/master/src/ro...</a><br>
at<br>
Note: The MVCS bundle changes these defaults. It adds a
TraceLogTarget and sets the log level to DEBUG.</p>
<h2><a name="far-as-i-try-is-" href="#far-as-i-try-is-" class=
"anchor" id="far-as-i-try-is-"></a>far as i try is</h2>
<pre>
<code>public class AppBundle extends MVCSBundle
{
override public function extend(context:IContext):void
{
// try...
context.logLevel = LogLevel.ERROR;
super.extend(context);
// try harder!
context.logLevel = LogLevel.ERROR;
}
}</code>
</pre>
<hr>
<p>but i still get DEBUG trace out...</p>
<p>or maybe some other way to completely turn it off?</p>
<p>Thanks</p></div>katopztag:robotlegs.tenderapp.com,2009-10-18:Comment/278353442013-07-18T12:58:58Z2013-07-18T12:58:58ZCan't change MVCS bundle defaults logLevel<div><p>Hi,</p>
<p>3 options:</p>
<ul>
<li>See the values for the log level constants:</li>
</ul>
<pre>
<code>public class LogLevel
{
public static const FATAL:uint = 2;
public static const ERROR:uint = 4;
public static const WARN:uint = 8;
public static const INFO:uint = 16;
public static const DEBUG:uint = 32;</code>
</pre>
<p>Now, set _context.logLevel = 0, or to an integer different from
the ones of the defined constants.</p>
<ul>
<li>
<p>Create your own MVCS bundle, where you can comment out the
context.logLevel = LogLevel.DEBUG; or set it to whatever else you
need it to be</p>
</li>
<li>
<p>if you don't need the TraceLoggingExtension at all, just don't
install it in your custom MVCS Bundle</p>
</li>
</ul>
<p>Here is the original MVCSBundle:<br>
<a href=
"https://github.com/robotlegs/robotlegs-framework/blob/master/src/robotlegs/bender/bundles/mvcs/MVCSBundle.as">
https://github.com/robotlegs/robotlegs-framework/blob/master/src/ro...</a></p>
<p>And , of course, if you create your own bundle then you'll have
to install it instead of the MVCSBundle</p>
<p>_context = new Context();</p>
<p>context.install(SomeCustomMVCSBundle):</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/278353442013-07-19T04:47:33Z2013-07-19T04:48:20ZCan't change MVCS bundle defaults logLevel<div><p>Hi,</p>
<p>After looking at the code, I feel that MVCSBundle shouldn't
has</p>
<p>context.logLevel = LogLevel.DEBUG;</p>
<p>like you said at option 2,</p>
<p>so i'm now work around by completely override public function
extend and won't call super (just realized my problem at first is
super set logLevel back eventually i call super.extend)</p>
<h2><a name=
"i-really-want-to-vote-to-get-rid-of-it-so-i-can-shorten-my-code-to-1-line-instead-of-plenty-of-import-and-extends-new-class-e-g-"
href=
"#i-really-want-to-vote-to-get-rid-of-it-so-i-can-shorten-my-code-to-1-line-instead-of-plenty-of-import-and-extends-new-class-e-g-"
class="anchor" id=
"i-really-want-to-vote-to-get-rid-of-it-so-i-can-shorten-my-code-to-1-line-instead-of-plenty-of-import-and-extends-new-class-e-g-">
</a>i really want to vote to get rid of it so i can shorten my code
to 1 line instead of plenty of import and extends new Class
e.g.</h2>
<h2><a name=
"new-context-install-mvcsbundle-signalcommandmapextension-" href=
"#new-context-install-mvcsbundle-signalcommandmapextension-" class=
"anchor" id=
"new-context-install-mvcsbundle-signalcommandmapextension-"></a>new
Context().install(MVCSBundle, SignalCommandMapExtension)</h2>
<h2><a name="compare-to-" href="#compare-to-" class="anchor" id=
"compare-to-"></a>compare to...</h2>
<p>new Context().install(AppBundle)</p>
<p>package<br>
{ import robotlegs.bender.bundles.mvcs.MVCSBundle; import
robotlegs.bender.extensions.contextView.ContextViewExtension;
import
robotlegs.bender.extensions.contextView.ContextViewListenerConfig;
import robotlegs.bender.extensions.contextView.StageSyncExtension;
import
robotlegs.bender.extensions.directCommandMap.DirectCommandMapExtension;
import
robotlegs.bender.extensions.enhancedLogging.InjectableLoggerExtension;
import
robotlegs.bender.extensions.enhancedLogging.TraceLoggingExtension;
import
robotlegs.bender.extensions.eventCommandMap.EventCommandMapExtension;
import
robotlegs.bender.extensions.eventDispatcher.EventDispatcherExtension;
import
robotlegs.bender.extensions.localEventMap.LocalEventMapExtension;
import
robotlegs.bender.extensions.mediatorMap.MediatorMapExtension;
import robotlegs.bender.extensions.modularity.ModularityExtension;
import
robotlegs.bender.extensions.signalCommandMap.SignalCommandMapExtension;
import
robotlegs.bender.extensions.viewManager.StageCrawlerExtension;
import
robotlegs.bender.extensions.viewManager.StageObserverExtension;
import
robotlegs.bender.extensions.viewManager.ViewManagerExtension;
import
robotlegs.bender.extensions.viewProcessorMap.ViewProcessorMapExtension;
import robotlegs.bender.extensions.vigilance.VigilanceExtension;
import robotlegs.bender.framework.api.IContext;</p>
<pre>
<code>public class AppBundle extends MVCSBundle
{
override public function extend(context:IContext):void
{
context.logLevel = 0;
context.install(TraceLoggingExtension,
VigilanceExtension,
InjectableLoggerExtension,
ContextViewExtension,
EventDispatcherExtension,
ModularityExtension,
DirectCommandMapExtension,
EventCommandMapExtension,
LocalEventMapExtension,
ViewManagerExtension,
StageObserverExtension,
MediatorMapExtension,
ViewProcessorMapExtension,
StageCrawlerExtension,
StageSyncExtension,
SignalCommandMapExtension);
context.configure(ContextViewListenerConfig);
}
}</code>
</pre>
<h2><a name="-" href="#-" class="anchor"></a>}</h2>
<p>all this just for silent log...which give me an awkward
moment</p>
<p>hope you guy see the problem and get rid of it ;\<br>
or i've to fork whole project to just comment this out?...still
awkward</p>
<p>no worry i just saying on sinking boat ;)</p>
<p>Thanks</p></div>katopztag:robotlegs.tenderapp.com,2009-10-18:Comment/278353442013-07-19T07:55:54Z2013-07-19T07:55:54ZCan't change MVCS bundle defaults logLevel<div><p>There's really no need to extend MVCSBundle, as long as it
implements<br>
IBundle it's fine.</p>
<p>And if you want to turn off logging altogether it's best to not
install<br>
TraceLoggingExtension and InjectableLoggerExtension.</p>
<p>And regarding the automatic loglevel setting: I don't know,
every developer<br>
will have her own idea on what should or should not be included in
the<br>
MVCSBundle. MVCSBundle's really just a convenience class, it was
never<br>
meant to be a mandatory class.</p></div>creynderstag:robotlegs.tenderapp.com,2009-10-18:Comment/278353442013-07-19T07:56:34Z2013-07-19T07:57:36ZCan't change MVCS bundle defaults logLevel<div><p>Yes, you're right, maybe the MVCSBundle should not install the
TraceLoggingExtension and set the logLevel.<br>
Until this will change, you can make your own bundle, as I
said:</p>
<pre>
<code>MinimalistBundle
public function extend(context:IContext):void
{
context.install(
VigilanceExtension,
ContextViewExtension,
EventDispatcherExtension,
DirectCommandMapExtension,
EventCommandMapExtension,
LocalEventMapExtension,
ViewManagerExtension,
StageObserverExtension,
MediatorMapExtension,
StageCrawlerExtension,
StageSyncExtension
);
context.configure(ContextViewListenerConfig);
}</code>
</pre>
<pre>
<code>_context = new Context()
.install(MinimalistBundle)
.configure(MediatorsConfig, ModelsConfig, ControllersConfig)
.configure(new ContextView(view));</code>
</pre>
<blockquote>
<p>all this just for silent log...which give me an awkward
moment</p>
</blockquote>
<p>The MVCSBundle is just a convenience class. If you use your own
bundle, you are free to customize it as you wish. For example, if
you don't have multiple contexts in your app, you don't need the
ModularityExtension, so you just don't include it in your
bundle...and so on.</p></div>Ondina D.F.