forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PAC infra utils -logging (sonic-net#18641)
- Loading branch information
1 parent
b9bd442
commit aade19a
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright 2024 Broadcom 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. | ||
*/ | ||
|
||
|
||
|
||
#include <syslog.h> | ||
|
||
/********************************************************************** | ||
* @purpose Format and record a message in the in-memory log. | ||
* | ||
* @param severity @b((input)} See RFC 3164 Section 4.1.1 Table 2 | ||
* @param component @b((input)} Level 7 component id | ||
* @param fileName @b{(input)} file name | ||
* @param lineNum @b{(input)} line number | ||
* @param nfo @b{(input)} extra information - null terminated string | ||
* | ||
* @returns None | ||
* | ||
* @notes This executes on the calling task thread. | ||
* | ||
* @end | ||
*********************************************************************/ | ||
|
||
void l7_log( LOG_SEVERITY_t severity, COMPONENT_IDS_t component, | ||
char8 * fileName, uint32 lineNum, char8 * nfo) | ||
{ | ||
syslog(severity, nfo) | ||
} | ||
|
||
|
||
/********************************************************************* | ||
* @purpose Log error and reset the box. | ||
* | ||
* @param error_code - 32-bit error code. | ||
* @param file_name - File where the error ocurred. | ||
* @param line_num - Line number where the error occurred. | ||
* | ||
* @returns none | ||
* | ||
* @notes This function may be called from an interrupt handler. | ||
* | ||
* @end | ||
*********************************************************************/ | ||
void | ||
log_error_code (uint32 err_code, | ||
char8 *file_name, | ||
uint32 line_num) | ||
{ | ||
syslog(LOG_ERROR:q | ||
|
||
return; | ||
} | ||
|