• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

STEllAR-GROUP / hpx / #882

31 Aug 2023 07:44PM UTC coverage: 41.798% (-44.7%) from 86.546%
#882

push

19442 of 46514 relevant lines covered (41.8%)

126375.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

4.76
/libs/full/runtime_components/src/server/console_logging_server.cpp
1
//  Copyright (c) 2007-2021 Hartmut Kaiser
2
//  Copyright (c)      2011 Bryce Lelbach
3
//
4
//  SPDX-License-Identifier: BSL-1.0
5
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
6
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7

8
#include <hpx/config.hpp>
9
#include <hpx/actions/transfer_action.hpp>
10
#include <hpx/async_distributed/continuation.hpp>
11
#include <hpx/async_distributed/transfer_continuation_action.hpp>
12
#include <hpx/modules/concurrency.hpp>
13
#include <hpx/modules/datastructures.hpp>
14
#include <hpx/modules/ini.hpp>
15
#include <hpx/modules/logging.hpp>
16
#include <hpx/modules/type_support.hpp>
17
#include <hpx/runtime_components/console_logging.hpp>
18
#include <hpx/runtime_components/server/console_logging.hpp>
19

20
#include <cstddef>
21
#include <mutex>
22
#include <string>
23

24
///////////////////////////////////////////////////////////////////////////////
25
// definitions related to console logging
26

27
namespace hpx { namespace util { namespace detail {
28

29
    struct log_lock_tag
30
    {
31
    };
32

33
    hpx::util::spinlock& get_log_lock()
×
34
    {
35
        hpx::util::static_<hpx::util::spinlock, log_lock_tag> lock;
36
        return lock.get();
×
37
    }
38
}}}    // namespace hpx::util::detail
39

40
///////////////////////////////////////////////////////////////////////////////
41
// This must be in global namespace
42
HPX_REGISTER_ACTION_ID(hpx::components::server::console_logging_action<>,
192✔
43
    console_logging_action, hpx::actions::console_logging_action_id)
44

45
///////////////////////////////////////////////////////////////////////////////
46
namespace hpx { namespace components { namespace server {
47

48
    ///////////////////////////////////////////////////////////////////////////
49
    // implementation of console based logging
50
    void console_logging(messages_type const& msgs)
×
51
    {
52
        std::lock_guard<util::spinlock> l(util::detail::get_log_lock());
53

54
        using hpx::get;
55

56
        for (message_type const& msg : msgs)
×
57
        {
58
            logging_destination const dest = get<0>(msg);
×
59
            std::size_t const level = get<1>(msg);
×
60
            std::string const& s = get<2>(msg);
61

62
            switch (dest)
×
63
            {
64
            // NOLINTNEXTLINE(bugprone-branch-clone)
65
            case logging_destination::hpx:
×
66
                LHPX_CONSOLE_(level) << s;
×
67
                break;
68

69
            case logging_destination::timing:
×
70
                LTIM_CONSOLE_(level) << s;
×
71
                break;
72

73
            case logging_destination::agas:
×
74
                LAGAS_CONSOLE_(level) << s;
×
75
                break;
76

77
            case logging_destination::parcel:
×
78
                LPT_CONSOLE_(level) << s;
×
79
                break;
80

81
            case logging_destination::app:
×
82
                LAPP_CONSOLE_(level) << s;
×
83
                break;
84

85
            case logging_destination::debuglog:
×
86
                LDEB_CONSOLE_ << s;
×
87
                break;
88

89
            default:
90
                HPX_UNUSED(level);
91
                break;
92
            }
93
        }
94
    }
×
95
}}}    // namespace hpx::components::server
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc