github.com/matrixorigin/matrixone@v1.2.0/pkg/logutil/adapt_s3_test.go (about)

     1  // Copyright 2022 Matrix Origin
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package logutil
    16  
    17  import (
    18  	"github.com/aws/smithy-go/logging"
    19  	"testing"
    20  )
    21  
    22  func TestS3Logger_Logf(t *testing.T) {
    23  	type args struct {
    24  		classification logging.Classification
    25  		format         string
    26  		v              []any
    27  	}
    28  	tests := []struct {
    29  		name string
    30  		args args
    31  	}{
    32  		{
    33  			name: "warn",
    34  			args: args{
    35  				classification: logging.Warn,
    36  				format:         "hello %s!",
    37  				v:              []any{"world"},
    38  			},
    39  		},
    40  		{
    41  			name: "debug",
    42  			args: args{
    43  				classification: logging.Debug,
    44  				format:         "hello %s!",
    45  				v:              []any{"world"},
    46  			},
    47  		},
    48  		{
    49  			name: "info",
    50  			args: args{
    51  				classification: "",
    52  				format:         "hello %s!",
    53  				v:              []any{"world"},
    54  			},
    55  		},
    56  	}
    57  	for _, tt := range tests {
    58  		t.Run(tt.name, func(t *testing.T) {
    59  			logger := GetS3Logger()
    60  			logger.Logf(tt.args.classification, tt.args.format, tt.args.v...)
    61  		})
    62  	}
    63  }