Line data Source code
1 : /* SPDX-FileCopyrightText: Copyright 2026 Cozens Software Solutions Limited
2 : * SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0 OR LicenseRef-PolyForm-Internal-Use-1.0.0 OR LicenseRef-COSOSO-Commercial
3 : */
4 :
5 : #include "SolidSyslogPrival.h"
6 :
7 : #include <stdint.h>
8 :
9 : #include "SolidSyslogErrorName.h"
10 :
11 : /* Indexed by the ladder, so no name can shift. */
12 11 : const char* SolidSyslogSeverity_Name(int32_t severity)
13 : {
14 : static const char* const names[(int32_t) SOLIDSYSLOG_SEVERITY_DEBUG + 1] = {
15 : [SOLIDSYSLOG_SEVERITY_EMERGENCY] = "EMERGENCY",
16 : [SOLIDSYSLOG_SEVERITY_ALERT] = "ALERT",
17 : [SOLIDSYSLOG_SEVERITY_CRITICAL] = "CRITICAL",
18 : [SOLIDSYSLOG_SEVERITY_ERROR] = "ERROR",
19 : [SOLIDSYSLOG_SEVERITY_WARNING] = "WARNING",
20 : [SOLIDSYSLOG_SEVERITY_NOTICE] = "NOTICE",
21 : [SOLIDSYSLOG_SEVERITY_INFORMATIONAL] = "INFORMATIONAL",
22 : [SOLIDSYSLOG_SEVERITY_DEBUG] = "DEBUG",
23 : };
24 :
25 11 : return SolidSyslogErrorName_Lookup(names, (int32_t) SOLIDSYSLOG_SEVERITY_DEBUG + 1, severity);
26 : }
|