| 1 |
/* |
| 2 |
* Copyright (c) 2024 Contributors to the Eclipse Foundation |
| 3 |
* |
| 4 |
* All rights reserved. This program and the accompanying materials |
| 5 |
* are made available under the terms of the Eclipse Public License v2.0 |
| 6 |
* and Eclipse Distribution License v1.0 which accompany this distribution. |
| 7 |
* |
| 8 |
* The Eclipse Public License is available at |
| 9 |
* https://www.eclipse.org/legal/epl-2.0/ |
| 10 |
* and the Eclipse Distribution License is available at |
| 11 |
* http://www.eclipse.org/org/documents/edl-v10.php. |
| 12 |
* |
| 13 |
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause |
| 14 |
*/ |
| 15 |
|
| 16 |
package log |
| 17 |
|
| 18 |
type ( |
| 19 |
// Logger interface allows implementations to provide to this package any |
| 20 |
// object that implements the methods defined in it. |
| 21 |
Logger interface { |
| 22 |
Println(v ...interface{}) |
| 23 |
Printf(format string, v ...interface{}) |
| 24 |
} |
| 25 |
|
| 26 |
// NOOPLogger implements the logger that does not perform any operation |
| 27 |
// by default. This allows us to efficiently discard the unwanted messages. |
| 28 |
NOOPLogger struct{} |
| 29 |
) |
| 30 |
|
| 31 |
// Println is the library provided NOOPLogger's |
| 32 |
// implementation of the required interface function() |
| 33 |
func (NOOPLogger) Println(v ...interface{}) {} |
| 34 |
|
| 35 |
// Printf is the library provided NOOPLogger's |
| 36 |
// implementation of the required interface function(){} |
| 37 |
func (NOOPLogger) Printf(format string, v ...interface{}) {} |