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