Naveen Sampath | 04696f7 | 2022-06-13 15:19:14 +0530 | [diff] [blame] | 1 | // +build !profile |
| 2 | |
| 3 | /* |
| 4 | * Copyright 2022-present Open Networking Foundation |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * |
| 15 | * |
| 16 | */ |
| 17 | |
| 18 | package pprofcontroller |
| 19 | |
| 20 | import ( |
| 21 | "github.com/opencord/voltha-lib-go/v7/pkg/log" |
Tinoj Joseph | 1d10832 | 2022-07-13 10:07:39 +0530 | [diff] [blame] | 22 | "context" |
Naveen Sampath | 04696f7 | 2022-06-13 15:19:14 +0530 | [diff] [blame] | 23 | ) |
| 24 | |
| 25 | var logger log.CLogger |
| 26 | var ctx = context.TODO() |
| 27 | |
| 28 | // Init to register package |
| 29 | func Init() { |
| 30 | // Setup this package so that it's log level can be modified at run time |
| 31 | var err error |
| 32 | logger, err = log.RegisterPackage(log.JSON, log.ErrorLevel, log.Fields{}) |
| 33 | if err != nil { |
| 34 | panic(err) |
| 35 | } |
| 36 | logger.Error(ctx, "Profiling is DISABLED") |
| 37 | } |
| 38 | |