Coverage Report

Created: 2026-01-17 06:53

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/opendnp3/cpp/lib/src/logging/LogLevels.cpp
Line
Count
Source
1
/*
2
 * Copyright 2013-2022 Step Function I/O, LLC
3
 *
4
 * Licensed to Green Energy Corp (www.greenenergycorp.com) and Step Function I/O
5
 * LLC (https://stepfunc.io) under one or more contributor license agreements.
6
 * See the NOTICE file distributed with this work for additional information
7
 * regarding copyright ownership. Green Energy Corp and Step Function I/O LLC license
8
 * this file to you under the Apache License, Version 2.0 (the "License"); you
9
 * may not use this file except in compliance with the License. You may obtain
10
 * a copy of the License at:
11
 *
12
 * http://www.apache.org/licenses/LICENSE-2.0
13
 *
14
 * Unless required by applicable law or agreed to in writing, software
15
 * distributed under the License is distributed on an "AS IS" BASIS,
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
 * See the License for the specific language governing permissions and
18
 * limitations under the License.
19
 */
20
21
#include "opendnp3/logging/LogLevels.h"
22
23
namespace opendnp3
24
{
25
26
const char* LogFlagToString(const LogLevel& flag)
27
0
{
28
0
    if (flag == flags::EVENT)
29
0
        return "EVENT  ";
30
0
    else if (flag == flags::ERR)
31
0
        return "ERROR  ";
32
0
    else if (flag == flags::WARN)
33
0
        return "WARN   ";
34
0
    else if (flag == flags::INFO)
35
0
        return "INFO   ";
36
0
    else if (flag == flags::DBG)
37
0
        return "DEBUG  ";
38
0
    else if (flag == flags::LINK_RX || flag == flags::LINK_RX_HEX)
39
0
        return "<-LL-- ";
40
0
    else if (flag == flags::LINK_TX || flag == flags::LINK_TX_HEX)
41
0
        return "--LL-> ";
42
0
    else if (flag == flags::TRANSPORT_RX)
43
0
        return "<-TL-- ";
44
0
    else if (flag == flags::TRANSPORT_TX)
45
0
        return "--TL-> ";
46
0
    else if (flag == flags::APP_HEADER_RX || flag == flags::APP_OBJECT_RX || flag == flags::APP_HEX_RX)
47
0
        return "<-AL-- ";
48
0
    else if (flag == flags::APP_HEADER_TX || flag == flags::APP_OBJECT_TX || flag == flags::APP_HEX_TX)
49
0
        return "--AL-> ";
50
0
    return "UNKNOWN";
51
0
}
52
53
} // namespace opendnp3