Commit Graph

1128 Commits

Author SHA1 Message Date
Timothy Stack
e286534cfc Merge branch 'fix-compile-warnings' of https://github.com/aspiers/lnav into aspiers-fix-compile-warnings 2016-12-16 22:50:45 -08:00
Timothy Stack
bc91a8e281 [log-view] show search hits in the left file line with a reverse-video marker
If the search-hit is past the right side of the screen (as mentioned in #394)
we should try to make that more obvious by adding a highlight on the left.
2016-12-10 07:35:08 -08:00
Timothy Stack
f567aafe3b [c++11] migration #1
Just a start
2016-12-10 07:21:24 -08:00
Timothy Stack
5e2d8842f2 forgot the actual file, sigh 2016-12-06 08:20:16 -08:00
Timothy Stack
93848faae7 add new file to dist 2016-12-06 07:14:54 -08:00
Timothy Stack
11d23a26d9 [build] libgpm autoconf check 2016-12-06 07:01:05 -08:00
Timothy Stack
d85ca570dd more travis 2016-12-06 06:22:43 -08:00
Timothy Stack
327b1b6e9f try turning libgpm complaint to a warning 2016-12-06 06:17:32 -08:00
Timothy Stack
3aa379ad44 use trusty 2016-12-05 16:51:05 -08:00
Timothy Stack
182a098dcb try to build c++11 on travis 2016-12-05 16:48:43 -08:00
Timothy Stack
44d93dddc3 [pretty-print] allow formats to do transforms before pretty-printing
Also started upgrading to C++11.

Fixes #353
2016-12-05 16:34:30 -08:00
Timothy Stack
02bfd5846b [hotkey] the n/N keys will now move to the next cluster of search hits, up to a screenful
Defect Number:
    Reviewed By:
   Testing Done:
2016-11-25 15:44:36 -08:00
Timothy Stack
95fe6f0d73 [hotkey] the n/N keys will now move to the next cluster of search hits, up to a screenful
Defect Number:
    Reviewed By:
   Testing Done:
2016-11-24 23:27:54 -08:00
Timothy Stack
09292fc23e remove -s flag
Fixes #363
2016-11-23 07:02:41 -08:00
Timothy Stack
642a94e7b7 [open] check for FIFOs
Fixes #380
2016-11-23 06:41:22 -08:00
Timothy Stack
a7a03470d7 [search] fix a typo in the timeval compare operator
Defect Number:
    Reviewed By:
   Testing Done:
2016-11-22 23:03:40 -08:00
Timothy Stack
4de576fba7 [search] after a search has been entered, move to the first hit if one is found quickly
Defect Number:
    Reviewed By:
   Testing Done:
2016-11-22 21:02:01 -08:00
Tim Stack
ec7dae5979 Merge pull request #391 from aspiers/more-time-formats
add two more common time formats
2016-11-22 15:16:57 -08:00
Adam Spiers
baa4ec0eb2 add two more common time formats
Since 26cd9f59 introduced stricter timestamp parsing so that
the full string now has to be matched, several of the 3rd party
formats installable via "lnav -i extra" broke.  So add a couple
more very common timestamp formats to address these.
2016-11-22 19:59:44 +00:00
Adam Spiers
fb96e948e2 fix -Wunused-result warning when calling getcwd()
Fix this warning:

    lnav_log.cc: In function ‘void log_host_info()’:
    lnav_log.cc:185:29: warning: ignoring return value of ‘char* getcwd(char*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
         getcwd(cwd, sizeof(cwd));
                                 ^
2016-11-22 19:42:41 +00:00
Adam Spiers
81f5a843cf check return value of git pull command
This is obviously worthwhile, but also eliminates this compiler warning:

    lnav.cc: In function ‘int main(int, char**)’:
    lnav.cc:2407:33: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
                     system(pull_cmd);
                                     ^
2016-11-22 19:42:41 +00:00
Adam Spiers
04627c1743 fix -Wunused-result warnings when calling read() and write()
Fix warnings like these:

    lnav.cc: In function ‘int main(int, char**)’:
    lnav.cc:2407:33: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
                     system(pull_cmd);
                                     ^
    lnav.cc:2966:66: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
                         write(STDOUT_FILENO, str.c_str(), str.size());
                                                                      ^
    lnav.cc:2967:50: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
                         write(STDOUT_FILENO, "\n", 1);
                                                      ^
2016-11-22 19:42:41 +00:00
Adam Spiers
dc500774a8 fix -Wsign-compare warnings in lnav_commands.cc
Fixes these warnings:

    lnav_commands.cc: In function ‘std::string remaining_args(const string&, const std::vector<std::basic_string<char> >&, size_t)’:
    lnav_commands.cc:67:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int lpc = 0; lpc < index; lpc++) {
                                 ^
    lnav_commands.cc: In function ‘std::string com_save_to(std::string, std::vector<std::basic_string<char> >&)’:
    lnav_commands.cc:574:53: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (int lpc = 0; lpc < dls.text_line_count(); lpc++) {
2016-11-22 19:42:41 +00:00
Adam Spiers
961cac8ec0 fix sscanf %qd type mismatch warning
Fixes this warning:

    relative_time.cc: In member function ‘bool relative_time::parse(const char*, size_t, relative_time::parse_error&)’:
    relative_time.cc:222:62: warning: format ‘%qd’ expects argument of type ‘long long int*’, but argument 3 has type ‘int64_t* {aka long int*}’ [-Wformat=]
                         if (sscanf(numstr.c_str(), "%qd", &number) != 1) {
                                                                  ^
2016-11-22 19:42:41 +00:00
Adam Spiers
2aebf4f381 fix -Wunused-result warnings when calling write()
Fix these warnings:

papertrail_proc.hh: In constructor ‘papertrail_proc::papertrail_proc(const string&, time_t, time_t)’:
papertrail_proc.hh:107:36: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
                  this->ptp_api_key);
                                    ^
papertrail_proc.hh: In member function ‘void papertrail_proc::set_url()’:
papertrail_proc.hh:146:47: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
                  this->ptp_quoted_search.in());
2016-11-22 19:42:41 +00:00
Adam Spiers
7988200701 fix -Wunused-result warnings when calling asprintf()
Fix these warnings:

papertrail_proc.hh: In constructor ‘papertrail_proc::papertrail_proc(const string&, time_t, time_t)’:
papertrail_proc.hh:107:36: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
                  this->ptp_api_key);
                                    ^
papertrail_proc.hh: In member function ‘void papertrail_proc::set_url()’:
papertrail_proc.hh:146:47: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
                  this->ptp_quoted_search.in());
2016-11-22 19:42:41 +00:00
Adam Spiers
43ac6366cb fix -Wformat time_t warnings (#368)
Fix warnings like:

    ptimec.hh: In function ‘void ftime_i(char*, off_t&, ssize_t, const exttm&)’:
    ptimec.hh:387:57: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
         snprintf(&dst[off_inout], len - off_inout, "%lld", t);
                                                             ^

In this case we know that the `t` returned by `tm2sec` is a number of
seconds, so a long should be long enough, and anyway there is already
code checking for overflow.

Fixes #368.

https://github.com/tstack/lnav/issues/368
2016-11-22 19:42:41 +00:00
Adam Spiers
0559a98f91 fix -Wsign-compare warnings (#369)
Fix repeated errors like this:

    log_format.hh:1138:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             if (len < jfe.jfe_min_width) {

Fixes #369.

https://github.com/tstack/lnav/issues/369
2016-11-22 19:42:41 +00:00
Timothy Stack
fb4e66e0b5 [build] package logfile_epoch.1 2016-11-22 10:02:38 -08:00
Timothy Stack
1b8b773184 [tests] print logfile::error exception 2016-11-22 09:56:08 -08:00
Timothy Stack
6618fe1947 [build] test 2016-11-22 09:48:05 -08:00
Timothy Stack
26cd9f5930 [ptime] make sure the full time stamp is matched
Fixes #389
Fixes #390
2016-11-22 08:38:45 -08:00
Timothy Stack
592ee60693 [log] fix rewriting machine-oriented timestamps
Fixes #371
2016-11-21 11:34:12 -08:00
Tim Stack
70240d2ca1 Merge pull request #376 from aspiers/fix-hour-help
fix hints about moving by hour
2016-11-19 20:42:51 -08:00
Adam Spiers
c18adb8b73 fix hints about moving by hour
o/O do not move forward/backward an hour; in fact, no hotkey does,
but 6/^ are about as close as it gets.
2016-11-20 01:56:22 +00:00
Tim Stack
742c8b553f Merge pull request #367 from aspiers/fix-compile
fix compile on SUSE
2016-11-19 11:11:38 -08:00
Tim Stack
a6f22f77ec Merge pull request #366 from aspiers/git-ignores
add some compile-time artefacts to .gitignore
2016-11-19 11:00:36 -08:00
Tim Stack
ae5f4b5dd5 Merge pull request #365 from aspiers/group-keybindings
Group keybindings in built-in help text
2016-11-19 11:00:17 -08:00
Adam Spiers
5c5027673d fix compile on SUSE
If we have both 64-bit and 32-bit versions of ncurses installed,
currently the 32-bit libraries in /lib get found first, so gcc fails to
link against them, and ./configure ends up thinking that we're missing
ncurses libraries.

So scan /lib64 before /lib.  There might be a better fix, but hopefully
it will avoid breaking 32-bit distributions and distributions which have
64-bit libraries in /lib.
2016-11-19 15:00:27 +00:00
Adam Spiers
db55d10039 add some compile-time artefacts to .gitignore 2016-11-19 14:35:43 +00:00
Adam Spiers
41acc7f249 group keybindings in built-in help text
Group them in roughly the same way as in the manual.  This makes
it a lot easier to locate a key binding more quickly.
2016-11-19 14:28:54 +00:00
Adam Spiers
c354295c92 increase emphasis of level 1 heading underlines
This will allow us to introduce level 2 headings underlined by the
hyphen character.
2016-11-19 14:18:57 +00:00
Timothy Stack
4712bb6f76 update test for json logs with objects/arrays 2016-11-11 20:45:56 -08:00
Timothy Stack
d8a49ec737 actual fix for json fields 2016-11-09 14:03:19 -08:00
Timothy Stack
a758056657 Revert "need to check level before incrementing line count"
This reverts commit c0cd26dec4.
2016-11-09 13:58:55 -08:00
Timothy Stack
c0cd26dec4 need to check level before incrementing line count 2016-11-09 13:31:51 -08:00
Tim Stack
9e82c6ba32 Merge pull request #360 from victorhooi/patch-1
Add Ctrl-W display shortcut for word-wrap.
2016-11-07 08:23:36 -08:00
Victor Hooi
ae42f97ba0 Add Ctrl-W display shortcut for word-wrap.
This is mentioned in the lnav 0.6.2 release notes:

http://lnav.org/blog/2013/11/10/word-wrap-support-in-v062

But doesn't appear to be mentioned elsewhere.
2016-11-07 17:39:02 +11:00
Timothy Stack
4c0a8d0376 [ptime] need to clear the zone from the base when using a custom time format 2016-11-04 11:00:51 -07:00
Timothy Stack
b296e84a65 [format] color extra json fields that are identifiers 2016-10-29 22:16:45 -07:00