From 561fe8b12db11b2c3eb1223a33ea679c815b3f36 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 5 May 2020 19:40:48 +0200 Subject: [PATCH] Lay the foundations for logging Podman in Go https://github.com/containers/toolbox/pull/318 --- src/meson.build | 1 + src/pkg/podman/podman.go | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/pkg/podman/podman.go diff --git a/src/meson.build b/src/meson.build index 970353a..3881844 100644 --- a/src/meson.build +++ b/src/meson.build @@ -4,6 +4,7 @@ go_build_wrapper_program = find_program('go-build-wrapper') sources = files( 'toolbox.go', 'cmd/root.go', + 'pkg/podman/podman.go', 'pkg/shell/shell.go', 'pkg/utils/utils.go', 'pkg/version/version.go', diff --git a/src/pkg/podman/podman.go b/src/pkg/podman/podman.go new file mode 100644 index 0000000..9f5ea1d --- /dev/null +++ b/src/pkg/podman/podman.go @@ -0,0 +1,29 @@ +/* + * Copyright © 2019 – 2020 Red Hat Inc. + * + * 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 podman + +import ( + "github.com/sirupsen/logrus" +) + +var ( + LogLevel = logrus.ErrorLevel +) + +func SetLogLevel(logLevel logrus.Level) { + LogLevel = logLevel +}