2 * Copyright (c) 2015. The CyanogenMod Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package com.cyanogenmod.eleven.ui.activities.preview.util;
19 import android.text.TextUtils;
20 import android.util.Log;
29 private static final String TAG = "AudioPreview";
31 private static boolean isDebugging() {
32 return Log.isLoggable(TAG, Log.DEBUG);
38 * @param tag {@link String}
39 * @param msg {@link String }
41 * @throws IllegalArgumentException {@link IllegalArgumentException}
43 public static void logd(String tag, String msg) throws IllegalArgumentException {
44 if (TextUtils.isEmpty(tag)) {
45 throw new IllegalArgumentException("'tag' cannot be empty!");
47 if (TextUtils.isEmpty(msg)) {
48 throw new IllegalArgumentException("'msg' cannot be empty!");
51 Log.d(TAG, tag + " [ " + msg + " ]");
58 * @param tag {@link String}
59 * @param msg {@link String }
61 * @throws IllegalArgumentException {@link IllegalArgumentException}
63 public static void loge(String tag, String msg) throws IllegalArgumentException {
64 if (TextUtils.isEmpty(tag)) {
65 throw new IllegalArgumentException("'tag' cannot be empty!");
67 if (TextUtils.isEmpty(msg)) {
68 throw new IllegalArgumentException("'msg' cannot be empty!");
70 Log.e(TAG, tag + " [ " + msg + " ]");