diff options
author | Xavier Ducrohet <xav@android.com> | 2012-08-15 16:55:00 -0700 |
---|---|---|
committer | android code review <noreply-gerritcodereview@google.com> | 2012-08-15 16:55:01 -0700 |
commit | 79ad870742142e531cda9463406a41a0fed3a658 (patch) | |
tree | e94fb93a0738a8b1fba62f9f53a1f4e331b9cd79 /common/src/com/android/utils/NullLogger.java | |
parent | b8a2851136c91b6c4ff795ac5b0227dbb3b78e58 (diff) | |
parent | bce43e3b692e09854ec7390411b6d5a7ccd60880 (diff) | |
download | sdk-79ad870742142e531cda9463406a41a0fed3a658.zip sdk-79ad870742142e531cda9463406a41a0fed3a658.tar.gz sdk-79ad870742142e531cda9463406a41a0fed3a658.tar.bz2 |
Merge "Create new logging class in the common library."
Diffstat (limited to 'common/src/com/android/utils/NullLogger.java')
-rw-r--r-- | common/src/com/android/utils/NullLogger.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/common/src/com/android/utils/NullLogger.java b/common/src/com/android/utils/NullLogger.java new file mode 100644 index 0000000..77f1ad5 --- /dev/null +++ b/common/src/com/android/utils/NullLogger.java @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.utils; + +/** + * Dummy implementation of an {@link ILogger}. + * <p/> + * Use {@link #getLogger()} to get a default instance of this {@link NullLogger}. + */ +public class NullLogger implements ILogger { + + private static final ILogger sThis = new NullLogger(); + + public static ILogger getLogger() { + return sThis; + } + + @Override + public void error(Throwable t, String errorFormat, Object... args) { + // ignore + } + + @Override + public void warning(String warningFormat, Object... args) { + // ignore + } + + @Override + public void info(String msgFormat, Object... args) { + // ignore + } + + @Override + public void verbose(String msgFormat, Object... args) { + // ignore + } + +} |