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

tstack / lnav / 17657281416-2508

11 Sep 2025 09:05PM UTC coverage: 64.984% (-0.2%) from 65.166%
17657281416-2508

push

github

tstack
[log2src] show source vars in message details

Improve selection of external editors and preserve
cursor location when opening from prompt.

Add CLion and RustRover as external editors.

Add breakpoint support

262 of 629 new or added lines in 26 files covered. (41.65%)

4 existing lines in 3 files now uncovered.

45653 of 70253 relevant lines covered (64.98%)

404292.82 hits per line

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

0.0
/src/src_ref.cc
1
/**
2
 * Copyright (c) 2025, Timothy Stack
3
 *
4
 * All rights reserved.
5
 *
6
 * Redistribution and use in source and binary forms, with or without
7
 * modification, are permitted provided that the following conditions are met:
8
 *
9
 * * Redistributions of source code must retain the above copyright notice, this
10
 * list of conditions and the following disclaimer.
11
 * * Redistributions in binary form must reproduce the above copyright notice,
12
 * this list of conditions and the following disclaimer in the documentation
13
 * and/or other materials provided with the distribution.
14
 * * Neither the name of Timothy Stack nor the names of its contributors
15
 * may be used to endorse or promote products derived from this software
16
 * without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND ANY
19
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
22
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 */
29

30
#include <vector>
31

32
#include "src_ref.hh"
33

34
#include "base/intern_string.hh"
35
#include "base/lnav.console.hh"
36
#include "base/result.h"
37
#include "lnav_util.hh"
38
#include "yajlpp/yajlpp.hh"
39
#include "yajlpp/yajlpp_def.hh"
40

41
namespace lnav {
42

43
static const typed_json_path_container<src_ref> ref_handlers = {
44
    yajlpp::property_handler("file")
45
        .with_synopsis("<path>")
46
        .with_description("The path to the source file")
47
        .for_field(&src_ref::sr_path),
48
    yajlpp::property_handler("line")
49
        .with_synopsis("<line-number>")
50
        .with_description("The line number containing the log statement")
51
        .for_field(&src_ref::sr_line_number),
52
    yajlpp::property_handler("name")
53
        .with_synopsis("<function-name>")
54
        .with_description(
55
            "The name of the function containing the log statement")
56
        .for_field(&src_ref::sr_function_name),
57
};
58

59
template<>
60
Result<src_ref, std::vector<lnav::console::user_message>>
NEW
61
from_json(const std::string& frag)
×
62
{
63
    static const auto STRING_SRC = intern_string::lookup("string");
NEW
64
    return ref_handlers.parser_for(STRING_SRC).of(frag);
×
65
}
66

67
}  // namespace lnav
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

© 2026 Coveralls, Inc