|
| 1 | +/* |
| 2 | + * Copyright 2024 Broadcom Inc. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +#include <syslog.h> |
| 20 | + |
| 21 | +/********************************************************************** |
| 22 | + * @purpose Format and record a message in the in-memory log. |
| 23 | + * |
| 24 | + * @param severity @b((input)} See RFC 3164 Section 4.1.1 Table 2 |
| 25 | + * @param component @b((input)} Level 7 component id |
| 26 | + * @param fileName @b{(input)} file name |
| 27 | + * @param lineNum @b{(input)} line number |
| 28 | + * @param nfo @b{(input)} extra information - null terminated string |
| 29 | + * |
| 30 | + * @returns None |
| 31 | + * |
| 32 | + * @notes This executes on the calling task thread. |
| 33 | + * |
| 34 | + * @end |
| 35 | + *********************************************************************/ |
| 36 | + |
| 37 | +void l7_log( LOG_SEVERITY_t severity, COMPONENT_IDS_t component, |
| 38 | + char8 * fileName, uint32 lineNum, char8 * nfo) |
| 39 | +{ |
| 40 | + syslog(severity, nfo) |
| 41 | +} |
| 42 | + |
| 43 | + |
| 44 | +/********************************************************************* |
| 45 | +* @purpose Log error and reset the box. |
| 46 | +* |
| 47 | +* @param error_code - 32-bit error code. |
| 48 | +* @param file_name - File where the error ocurred. |
| 49 | +* @param line_num - Line number where the error occurred. |
| 50 | +* |
| 51 | +* @returns none |
| 52 | +* |
| 53 | +* @notes This function may be called from an interrupt handler. |
| 54 | +* |
| 55 | +* @end |
| 56 | +*********************************************************************/ |
| 57 | +void |
| 58 | +log_error_code (uint32 err_code, |
| 59 | + char8 *file_name, |
| 60 | + uint32 line_num) |
| 61 | +{ |
| 62 | + syslog(LOG_ERROR:q |
| 63 | + |
| 64 | + return; |
| 65 | +} |
| 66 | + |
0 commit comments