log
log
#
Log — the tree of entries one to() block writes, and the one place it changes.
- Add.
addandadd_progressput a new entry beneath a parent — or, when the parent lies inside an iteratedProgress, revise the entry already in that call site's slot for this iteration (the loop rule), so a line logged every iteration is one line, not thousands. A revised entry is logged anew: its clock restarts, a past failure clears, and what was logged beneath it before is dropped, so it shows only its latest run. - Change. Every mutation runs inside
changing(entry): under the log's lock, then the revision bumps and every sink is told. - Read.
entries(parents before children),childrenandjsonare the views a sink or a renderer takes.
Site = tuple[CodeType, int]
#
The code location that logged: a function's code object and a line in it.
Slot = tuple[str, str] | tuple[CodeType, int, int]
#
Where an entry sits beneath its parent: a key, or a site and its ordinal this iteration.
Log
#
The entries of one to() block; root is the unlogged parent of the top level.
Source code in capturegraph-lib/capturegraph/logging/log.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |
__init__(sinks)
#
An empty log whose entries go to sinks.
Source code in capturegraph-lib/capturegraph/logging/log.py
add(parent, level, message, fields, *, key, kind, site)
#
A line beneath parent, or the revised line already in its slot.
Source code in capturegraph-lib/capturegraph/logging/log.py
add_progress(parent, label, *, key, site, total, iterable)
#
A count beneath parent, or the one already in its slot, reset to start over.
Source code in capturegraph-lib/capturegraph/logging/log.py
changing(entry)
#
Mutate entry in the block; then its revision bumps and the sinks hear.
children(parent)
#
The entries directly beneath parent (root for the top level), oldest first.