2 * Copyright (C) 2010 Prasanta Paul, http://prasanta-paul.blogspot.com
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
20 * Based on your target platform- edit this file and add appropriate Log console
\r
22 * for Android, android.util.Log
\r
23 * for J2ME, Desktop File based logging.
\r
25 * By default Logging will be enabled
\r
27 * @author Prasanta Paul
\r
33 * Set to false if you don't need Log output
\r
35 private static boolean isLogEnabled = true;
\r
41 public static void enableLog(){
\r
42 isLogEnabled = true;
\r
45 * Disable logging. Good for production release.
\r
47 public static void disableLog(){
\r
48 isLogEnabled = false;
\r
52 * @param tag Log TAG
\r
53 * @param msg Log Message
\r
55 public static void p(String tag, String msg){
\r
61 print("["+ tag +"] ");
\r
67 private static void print(String s){
\r
68 // TODO: Add appropriate stream based on your platform
\r
69 System.out.print(s);
\r