コード例 #1
0
        void InitializeLogging()
        {
            // Wraps Android's native log framework.
            LogWrapper logWrapper = new LogWrapper();

            // Using Log, front-end to the logging chain, emulates android.util.log method signatures.
            Log.LogNode = logWrapper;
            // Filter strips out everything except the message text.
            MessageOnlyLogFilter msgFilter = new MessageOnlyLogFilter();

            logWrapper.NextNode = msgFilter;
            // On screen logging via a customized TextView.
            LogView logView = FindViewById <LogView>(Resource.Id.sample_logview);

            logView.SetTextAppearance(this, Resource.Style.Log);
            logView.SetBackgroundColor(Color.White);
            msgFilter.NextNode = logView;
            Log.Info(TAG, "Ready");
        }