Skip to content

Commit

Permalink
finally a semi-acceptable field table
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoud committed Apr 17, 2015
1 parent ea3092e commit dff74f8
Showing 1 changed file with 94 additions and 55 deletions.
149 changes: 94 additions & 55 deletions lithoxyl/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,63 +4,102 @@
:class:`~lithoxyl.record.Record`. Sinks can take advantage of these
with the :class:`~lithoxyl.formatters.Formatter` type or subtypes.
+-----------------+-----------------------------+-------+
| Name | Description | Quoted|
+=================+=============================+=======+
| logger_name | | Y |
+-------------------------------------------------------+
| logger_id | | |
+-------------------------------------------------------+
| record_name | | Y |
+-------------------------------------------------------+
| record_id | | |
+-------------------------------------------------------+
| status_str | | |
+-------------------------------------------------------+
| status_char | | |
+-------------------------------------------------------+
| warn_char | | |
+-------------------------------------------------------+
| level_name | | |
+-------------------------------------------------------+
| extras | | |
+-------------------------------------------------------+
|level_name_upper | | |
+-------------------------------------------------------+
| level_number | | |
+-------------------------------------------------------+
| message | | Y |
+-------------------------------------------------------+
| raw_message | | Y |
+-------------------------------------------------------+
|begin_timestamp | | |
+-------------------------------------------------------+
| end_timestamp | | |
+-------------------------------------------------------+
| duration_secs | | |
+-------------------------------------------------------+
| duration_msecs | | |
+-------------------------------------------------------+
| module_name | | Y |
+-------------------------------------------------------+
| module_path | | Y |
+-------------------------------------------------------+
| func_name | | |
+-------------------------------------------------------+
| line_number | | |
+-------------------------------------------------------+
| exc_type | | |
+-------------------------------------------------------+
| exc_message | | Y |
+-------------------------------------------------------+
| exc_tb_str | | Y |
+-------------------------------------------------------+
| exc_tb_list | | Y |
+-------------------------------------------------------+
| process_id | | |
+-----------------+-----------------------------+-------+
General Fields
--------------
+----------------------+-----------------------------------------------+----------------------------------+----------+
| Name | Example | Description | Quoted |
+======================+===============================================+==================================+==========+
| ``logger_name`` | ``"test_logger"`` | X X | Y |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``logger_id`` | ``139890693478288`` | X X | |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``record_name`` | ``"test_task"`` | X X | Y |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``record_id`` | ``139890664630288`` | X X | |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``status_str`` | ``exception`` | X X | |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``status_char`` | ``E`` | X X | |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``warn_char`` | ``W`` | X X | |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``level_name`` | ``critical`` | X X | |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``extras`` | ``{"item": "my_item"}`` | X X | |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``level_name_upper`` | ``CRITICAL`` | X X | |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``level_number`` | ``90`` | X X | |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``message`` | ``"test_task raised ... ue for my_item',)"`` | X X | Y |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``raw_message`` | ``"test_task raised ... lue for {item}',)"`` | X X | Y |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``begin_timestamp`` | ``1429320301.9148`` | X X | |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``end_timestamp`` | ``1429320302.6157`` | X X | |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``duration_secs`` | ``0.701`` | X X | |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``duration_msecs`` | ``700.887`` | X X | |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``module_name`` | ``"__main__"`` | X X | Y |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``module_path`` | ``"gen_field_table.py"`` | X X | Y |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``func_name`` | ``get_test_record`` | X X | |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``line_number`` | ``27`` | X X | |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``exc_type`` | ``ValueError`` | X X | |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``exc_message`` | ``"unexpected value for {item}"`` | X X | Y |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``exc_tb_str`` | ``"Traceback (most r ... ue for {item}')"`` | X X | Y |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``exc_tb_list`` | ``"[Callpoint('get_t ... for {item}')\\")]"`` | X X | Y |
+----------------------+-----------------------------------------------+----------------------------------+----------+
| ``process_id`` | ``{process_id}`` | X X | |
+----------------------+-----------------------------------------------+----------------------------------+----------+
Timestamp Fields
----------------
+-----------------------------------+-------------------------------------+----------------------------------+
| Name | Example | Description |
+===================================+=====================================+==================================+
| ``begin_iso8601`` | ``2015-04-18T01:25:01.914817+0000`` | X X |
+-----------------------------------+-------------------------------------+----------------------------------+
| ``end_iso8601`` | ``2015-04-18T01:25:02.615704+0000`` | X X |
+-----------------------------------+-------------------------------------+----------------------------------+
| ``begin_iso8601_notz`` | ``2015-04-18T01:25:01.914817`` | X X |
+-----------------------------------+-------------------------------------+----------------------------------+
| ``end_iso8601_notz`` | ``2015-04-18T01:25:02.615704`` | X X |
+-----------------------------------+-------------------------------------+----------------------------------+
| ``begin_local_iso8601`` | ``2015-04-17T18:25:01.914817-0700`` | X X |
+-----------------------------------+-------------------------------------+----------------------------------+
| ``end_local_iso8601`` | ``2015-04-17T18:25:02.615704-0700`` | X X |
+-----------------------------------+-------------------------------------+----------------------------------+
| ``begin_local_iso8601_notz`` | ``2015-04-17T18:25:01.914817`` | X X |
+-----------------------------------+-------------------------------------+----------------------------------+
| ``end_local_iso8601_notz`` | ``2015-04-17T18:25:02.615704`` | X X |
+-----------------------------------+-------------------------------------+----------------------------------+
| ``begin_local_iso8601_noms`` | ``2015-04-17 18:25:01 PDT`` | X X |
+-----------------------------------+-------------------------------------+----------------------------------+
| ``end_local_iso8601_noms`` | ``2015-04-17 18:25:02 PDT`` | X X |
+-----------------------------------+-------------------------------------+----------------------------------+
| ``begin_local_iso8601_noms_notz`` | ``2015-04-17 18:25:01`` | X X |
+-----------------------------------+-------------------------------------+----------------------------------+
| ``end_local_iso8601_noms_notz`` | ``2015-04-17 18:25:02`` | X X |
+-----------------------------------+-------------------------------------+----------------------------------+
"""
# NOTE: docstring table needs slashes double escaped. Also, newline literals "\n" removed.

# TODO: should record_id be combined with logger_id? loggers are not
# ephemeral, but records are; there are chances of id reuse.

import time
import json
Expand Down

0 comments on commit dff74f8

Please sign in to comment.