ConsoleMessage messageLevel - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ConsoleMessage messageLevel method.

This code example shows how to use the following methods:lineNumber, message, messageLevel, sourceId
	} 
 
	@Override 
	public boolean onConsoleMessage(ConsoleMessage message)
	{ 
		switch (message.messageLevel()) {
			case DEBUG:
				Log.d(CONSOLE_TAG, message.message() + " (" + message.lineNumber() + ":" + message.sourceId() + ")");
				break; 
			default: 
				Log.i(CONSOLE_TAG, message.message() + " (" + message.lineNumber() + ":"+ message.sourceId() + ")");
				break; 
		} 
		return true; 
	} 
 
	public boolean onJsAlert(WebView view, String url, String message, final android.webkit.JsResult result)
	{ 
		TiUIHelper.doOkDialog("Alert", message, new OnClickListener() {
			public void onClick(DialogInterface dialog, int which) {
9
CodeRank
This code example shows how to use the following methods:lineNumber, message, messageLevel, sourceId
                    view = convertView;
                } 
 
                TextView headline = (TextView) view.findViewById(android.R.id.text1);
                TextView subText = (TextView) view.findViewById(android.R.id.text2);
                headline.setText(error.sourceId() + ":" + error.lineNumber());
                subText.setText(error.message());
                switch (error.messageLevel()) {
                    case ERROR:
                        subText.setTextColor(Color.RED);
                        break; 
                    case WARNING:
                        // Orange 
                        subText.setTextColor(Color.rgb(255,192,0));
                        break; 
                    case TIP:
                        subText.setTextColor(Color.BLUE);
                        break; 
                    default: 
                        subText.setTextColor(Color.LTGRAY);
7
CodeRank
This code example shows how to use the following methods:lineNumber, message, messageLevel, sourceId
    } 
 
    private class HelloWebChromeClient extends WebChromeClient {
        @Override 
        public boolean onConsoleMessage(ConsoleMessage cm) {
            Log.d(TAG, cm.message()
                    + " -- " + cm.messageLevel()
                    + " From line " + cm.lineNumber()
                    + " of " + cm.sourceId() );
            return true; 
        } 
    } 
 
    @Override 
    public void onCreate(Bundle savedInstanceState)
    { 
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
 
        mWebView = (WebView) findViewById(R.id.webview);
6
CodeRank
This code example shows how to use the following methods:message, messageLevel
        } 
    } 
 
    @Override 
    public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
        switch (consoleMessage.messageLevel()) {
        case ERROR:
            Log.e(TAG, consoleMessage.message());
            break; 
        case WARNING:
            Log.w(TAG, consoleMessage.message());
            break; 
        case DEBUG:
            Log.d(TAG, consoleMessage.message());
            break; 
        case TIP:
        case LOG:
        default: 
            Log.i(TAG, consoleMessage.message());
        } 

6
CodeRank
This code example shows how to use the following methods:lineNumber, message, messageLevel, sourceId
                    view = convertView;
                } 
 
                TextView headline = (TextView) view.findViewById(android.R.id.text1);
                TextView subText = (TextView) view.findViewById(android.R.id.text2);
                headline.setText(error.sourceId() + ":" + error.lineNumber());
                subText.setText(error.message());
                switch (error.messageLevel()) {
                    case ERROR:
                        subText.setTextColor(Color.RED);
                        break; 
                    case WARNING:
                        // Orange 
                        subText.setTextColor(Color.rgb(255,192,0));
                        break; 
                    case TIP:
                        subText.setTextColor(Color.BLUE);
                        break; 
                    default: 
                        subText.setTextColor(Color.LTGRAY);
5
CodeRank
This code example shows how to use the following methods:lineNumber, message, messageLevel, sourceId
                    view = convertView;
                } 
 
                TextView headline = (TextView) view.findViewById(android.R.id.text1);
                TextView subText = (TextView) view.findViewById(android.R.id.text2);
                headline.setText(error.sourceId() + ":" + error.lineNumber());
                subText.setText(error.message());
                switch (error.messageLevel()) {
                    case ERROR:
                        subText.setTextColor(Color.RED);
                        break; 
                    case WARNING:
                        // Orange 
                        subText.setTextColor(Color.rgb(255,192,0));
                        break; 
                    case TIP:
                        subText.setTextColor(Color.BLUE);
                        break; 
                    default: 
                        subText.setTextColor(Color.LTGRAY);
5
CodeRank
This code example shows how to use the following methods:messageLevel
    { 
 
        @Override 
        public boolean onConsoleMessage( ConsoleMessage consoleMessage )
        { 
            if ( consoleMessage.messageLevel() == ConsoleMessage.MessageLevel.ERROR ) {
                android.util.Log.e( "JSConsole:", buildConsoleMessageLog( consoleMessage ) );
            } else { 
                android.util.Log.d( "JSConsole:", buildConsoleMessageLog( consoleMessage ) );
            } 
            return true; 
        } 
 
    } 
 
    public static class ConsoleAndrologWebChromeClient 
            extends WebChromeClient
    { 
 
        @Override 
5
CodeRank

Related ConsoleMessage messageLevel Questions & Answers:

messageLevel Method Overview
See Code Examples for other Android ConsoleMessage Methods: