Commit Graph

22 Commits

Author SHA1 Message Date
Yu Watanabe db9ecf0501 license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
HATAYAMA Daisuke 27f31daf3e shared/logs-show: Remove unused OUTPUT_FOLLOW
As of the commit aae9a96d4b removing --follow
option in systemctl command, OUTPUT_FOLLOW has never been set anywhere. Let's
remove it.

The condition expression of the if-statement in show_journal() that refers to
OUTPUT_FOLLOW now thus evaluates always to true. Hence, the call of
sd_journal_wait() is in dead code, and the outer infinite for-loop is
meaningless, which we remove as cleanup.

There is no functional change by this commit.
2020-03-02 18:27:55 +09:00
Lennart Poettering e4cbdffe28 output-mode: add new helper OUTPUT_MODE_IS_JSON()
Just a pretty way to determine whether the selected output mode is a
JSON output mode.
2018-12-03 22:42:38 +01:00
Lennart Poettering 9e964bb8e4 output-mode: add generic helper to pick right JsonFormatFlags for given OutputMode 2018-12-03 22:42:38 +01:00
Lennart Poettering 8e04444385 journalctl: port JSON output mode to new JSON API
Also, while we are at it, beef it up, by adding json-seq support (i.e.
https://tools.ietf.org/html/rfc7464). This is particularly useful in
conjunction with jq's --seq switch.
2018-10-11 17:25:27 +02:00
Lennart Poettering 0c69794138 tree-wide: remove Lennart's copyright lines
These lines are generally out-of-date, incomplete and unnecessary. With
SPDX and git repository much more accurate and fine grained information
about licensing and authorship is available, hence let's drop the
per-file copyright notice. Of course, removing copyright lines of others
is problematic, hence this commit only removes my own lines and leaves
all others untouched. It might be nicer if sooner or later those could
go away too, making git the only and accurate source of authorship
information.
2018-06-14 10:20:20 +02:00
Lennart Poettering 818bf54632 tree-wide: drop 'This file is part of systemd' blurb
This part of the copyright blurb stems from the GPL use recommendations:

https://www.gnu.org/licenses/gpl-howto.en.html

The concept appears to originate in times where version control was per
file, instead of per tree, and was a way to glue the files together.
Ultimately, we nowadays don't live in that world anymore, and this
information is entirely useless anyway, as people are very welcome to
copy these files into any projects they like, and they shouldn't have to
change bits that are part of our copyright header for that.

hence, let's just get rid of this old cruft, and shorten our codebase a
bit.
2018-06-14 10:20:20 +02:00
Luca Boccassi 49805b3d81 journalctl: add with-unit mode
When dealing with a large number of template instances, for example
when launching daemons per VRF, it is hard for operators to correlate
log lines to arguments.
Add a new with-unit mode which, if available, prefixes unit and user
unit names when displaying its log messages instead of the syslog
identifier. It will also use the full timestamp with timezones, like
the short-full mode.
2018-05-25 14:45:34 +02:00
Zbigniew Jędrzejewski-Szmek 11a1589223 tree-wide: drop license boilerplate
Files which are installed as-is (any .service and other unit files, .conf
files, .policy files, etc), are left as is. My assumption is that SPDX
identifiers are not yet that well known, so it's better to retain the
extended header to avoid any doubt.

I also kept any copyright lines. We can probably remove them, but it'd nice to
obtain explicit acks from all involved authors before doing that.
2018-04-06 18:58:55 +02:00
Zbigniew Jędrzejewski-Szmek 53e1b68390 Add SPDX license identifiers to source files under the LGPL
This follows what the kernel is doing, c.f.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
2017-11-19 19:08:15 +01:00
Ian Wienand 7e563bfc97 Add short-iso-precise for journalctl output (#5884)
This adds a short-iso-precise option for journalctl output.  It is similar to
short-iso, but includes microseconds.
2017-05-07 20:23:49 -04:00
Lennart Poettering 29a753df76 journalctl: add new output mode "short-full" (#3880)
This new output mode formats all timestamps using the usual format_timestamp()
call we use pretty much everywhere else. Timestamps formatted this way are some
ways more useful than traditional syslog timestamps as they include weekday,
month and timezone information, while not being much longer. They are also not
locale-dependent. The primary advantage however is that they may be passed
directly to journalctl's --since= and --until= switches as soon as #3869 is
merged.

While we are at it, let's also add "short-unix" to shell completion.
2016-08-03 19:45:07 -04:00
Lennart Poettering 991e274b61 journalctl: add --no-hostname switch
This suppresses output of the hostname for messages from the local system.

Fixes: #2342
2016-04-22 16:16:59 +02:00
Lennart Poettering bb321ed9a3 journalctl: add output mode where time is shown in seconds since 1st Jan 1970 UTC
aka "UNIX time".

Fixes: #2120
2016-04-22 16:16:59 +02:00
Lennart Poettering 766cd08152 shared: move output_mode_to_string() into output-mode.c
After all, the enum definition is in output-mode.h
2016-04-22 16:16:59 +02:00
Lennart Poettering 0ff308c8de shared: drop kernel_thread bool from cgroups show code
Make this an output flag instead, so that our function prototypes can lose one
parameter
2016-04-22 16:06:20 +02:00
Daniel Mack b26fa1a2fb tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file.
2016-02-10 13:41:57 +01:00
Jan Synacek 9fd290443f journalctl: add --utc option
Introduce option to display time in UTC.
2014-10-02 14:52:32 +02:00
Lennart Poettering ea6c2dd1f8 systemctl: suppress duplicate newline if there's not log output in "systemctl status" 2014-03-13 04:17:37 +01:00
Zbigniew Jędrzejewski-Szmek f02d836794 logs-show: add short-precise mode with us timestamps
Also, always show us timestamps in verbose mode.

https://bugzilla.redhat.com/show_bug.cgi?id=991678
2013-08-20 21:18:43 -04:00
Tomasz Torcz 44bc6e1fe0 journalctl: add ”short-iso” output format with verbose ISO8601 timestamps
Example:
2013-07-18T10:10:01+0200 sandworm CROND[20957]: (root) CMD (/usr/lib64/sa/sa1 1 1)
2013-07-18 15:58:49 +02:00
Lukas Nykryn 9bdbc2e2ec systemctl,loginctl,cgls: do not ellipsize cgroup members when --full is specified
New file output.h with output flags and modes.

--full parameter also for cgls and loginctl.

Include 'all' parameter in flags (show_cgroup_by_path, show_cgroup,
show_cgroup_and_extra, show_cgroup_and_extra_by_spec).

get_process_cmdline with max_length == 0 will not ellipsize output.

Replace LINE_MAX with 0 in some calls of get_process_cmdline.

[zj: Default to --full when under pager for clgs.
     Drop '-f' since it wasn't documented and didn't actually work.
     Reindent a bit.
]
2013-01-16 12:11:47 -05:00