From 5df3f54dfe0f3a6d710b4f0dcf0205ec83e2c8e7 Mon Sep 17 00:00:00 2001 From: chenyarong Date: Thu, 28 Dec 2023 12:24:21 +0800 Subject: [PATCH] fix for ci * add copyright * remove unused function --- pkg/logger/hub.go | 24 +++++++++++++++++------- pkg/logger/logger_test.go | 17 +++++++++++++++++ 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/pkg/logger/hub.go b/pkg/logger/hub.go index f620f7242f..8ba3a16c7a 100644 --- a/pkg/logger/hub.go +++ b/pkg/logger/hub.go @@ -1,3 +1,20 @@ +/* + * Copyright (c) 2017, MegaEase + * All rights reserved. + * + * 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 logger import ( @@ -29,13 +46,6 @@ func (lh *logHub) register(name string, logger *zap.SugaredLogger) { lh.loggers[name] = logger } -func (lh *logHub) unregister(name string) { - lh.mu.Lock() - defer lh.mu.Unlock() - - delete(lh.loggers, name) -} - // sync syncs all loggers. func (lh *logHub) sync() { lh.mu.RLock() diff --git a/pkg/logger/logger_test.go b/pkg/logger/logger_test.go index 978457be4f..a866a4b990 100644 --- a/pkg/logger/logger_test.go +++ b/pkg/logger/logger_test.go @@ -1,3 +1,20 @@ +/* + * Copyright (c) 2017, MegaEase + * All rights reserved. + * + * 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 logger import (