Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: describe default prefix format #1045

Merged
merged 1 commit into from
Jan 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,47 @@ The default path to a log file on Linux, for instance, could be
By default, glog echos ``ERROR`` and ``FATAL`` messages to standard error in
addition to log files.


Log Line Prefix Format
~~~~~~~~~~~~~~~~~~~~~~

Log lines have this form:

::

Lyyyymmdd hh:mm:ss.uuuuuu threadid file:line] msg...

where the fields are defined as follows:

==================== =========================================================================
Placeholder Meaning
==================== =========================================================================
``L`` A single character, representing the log level (e.g., ``I`` for ``INFO``)
``yyyy`` The year
``mm`` The month (zero padded; i.e., May is ``05``)
``dd`` The day (zero padded)
``hh:mm:ss.uuuuuu`` Time in hours, minutes and fractional seconds
``threadid`` The space-padded thread ID
``file`` The file name
``line`` The line number
``msg`` The user-supplied message
==================== =========================================================================

Example:

::

I1103 11:57:31.739339 24395 google.cc:2341] Command line: ./some_prog
I1103 11:57:31.739403 24395 google.cc:2342] Process id 24395

.. pull-quote::
[!NOTE]

Although microseconds are useful for comparing events on a single machine,
clocks on different machines may not be well synchronized. Hence, use with
caution when comparing the low bits of timestamps from different machines.


Setting Flags
~~~~~~~~~~~~~

Expand Down