This patch adds support for timestamped log files with the format
Since timestamp many times will not take epoc time as the source of the
timestamp but the time the system started, the initial datetime will be
calculated by substracting from the file modified datetime the last
timestamp in the file.
Option added is --timestamp-logs or -tl, and it also supports ALIAS and
globs, and is also affected by base directory and postfix options.
This patch adds support for log files that use the same datetime format
as /var/log/messages, which is in the for of Oct 15 14:11:19.
Year will from last modification to the file will be used to complete
In the process of refactoring the read of the logs the OpenStack log
reading has been simplified to not require the presence of PID or LEVEL,
thus providing more compatibility with custom log formats (as long as
default datetime format is being used).
With this refactoring it is now easier to add new datetime formats to
Option added is --msg-logs or -ml and it also supports ALIAS and globs,
and is also affected by base directory and postfix options.
TODO: If year of file creation and file last modification are different
we should start with the cration year and then change to the next year
once the months go back.
When one of the log files is empty and we use `-m` option we will get no
output, unlike normal operation that would output contents of all other
This patch fixes this by removing from the files to read empty ones like
we do once we start processing the files.