I am using MvvmCross in the library, I use the Mvx.Trace method, but no one in the console / output window No output. How to use it?
PS I have set the compiler constant trace = true
thanks.
MvvmCross debugress is the implementation of the IMvxTrace
All are routed through. Each platform offers different implementations of this:
- Windows platform
debug trace (because
trace is not available on all Windows platforms itself)
Both Android
debug and Android
logs
both iOS and console console
Uses double logs of both. It works well in previous versions of MVVCross, especially where people are directly connected to MVVCrc source code and therefore can directly release debug or MVVM cross binaries.
However ... because now people are fast using Binaries from Release Nungeet - where
debugs are compiled exactly, then it often leaves people "Raja" How to use? "
The easiest way is that you can override the initiality of IMvxTrace in your
setup category.
It's easy to do - Example:
Protected Override IMvxTrace CreateDebugTrace () {New MyDebugTrace (); }
Where
MyDebugTrace is something:
Public category MyDebugTrace: IMvxTrace {public zero trace (MvxTraceLevel level, string tag , Funk & lt; string & gt; Message) {Debug.WriteLine (Tag + ":" + level + ":" + Message ()); } Public Zero Trace (MvxTraceLevel Level, String Tags, String Message) {Debug.WriteLine (Tag + ":" + Level + ":" + Message); } Public Zero Trace (MvxTraceLevel Level, String Tags, String Message, Paramos Object [] ARGs) {try {Debug.WriteLine (string.Format (tag + ":" + level + ":" + message, args)); } Hold (format exception) {trace (MvxTraceLevel.Error, tag, "{0} {1} {2}", the exception of the level, message mark;); }}}
If you want to include separate implementations for debug / release; If you want to turn it on / off at runtime; If you want to filter on
MvxTraceLevel or
tags ; Or if you want to use some third party logging engine, it will be easy to use simple C # on each platform.
No comments:
Post a Comment