Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.util.Log;

public class Main {
    /**
     * Method to trim log messages for error
     *
     * @param TAG     Tag for the message
     * @param message Message to log
     */
    public static void e(String TAG, String message) {
        int maxLogSize = 1000;
        for (int index = 0; index <= message.length() / maxLogSize; index++) {
            int start = index * maxLogSize;
            int end = (index + 1) * maxLogSize;
            end = end > message.length() ? message.length() : end;
            Log.e(TAG, message.substring(start, end));
        }
    }
}