(annotate! element & args)
Side-effect, adds args
to entry for element
in log-graph
Where
args
:= [predicate
object
, ...]element
is an element of the log-graphSide-effect, adds `args` to entry for `element` in log-graph Where - `args` := [`predicate` `object`, ...] - `element` is an element of the log-graph
(archiving?)
(archiving? g)
True iff archiving is enabled for g
Where:
g
is an IGraph being used as a log-graph (default log-graph
)True iff archiving is enabled for `g` Where: - `g` is an IGraph being used as a log-graph (default [[log-graph]])
(compare-shared-entries g1 g2)
Returns an IGraph containing content shared between g1
and g2
Where
g1
, g2
are @log-graph's from two different sessions.Returns an IGraph containing content shared between `g1` and `g2` Where - `g1`, `g2` are @log-graph's from two different sessions.
(entries)
(entries entry-type)
(entries g entry-type)
Returns [entry-id
, ...] for entry-type
in g
ordered by :glog/executionOrder
Where
entry-id
is a KWI identifying a log event in g
g
is an optional IGraph supporting the logging ontology, (default log-graph)
This is typically either the current log-graph or a copy of the log-grpah
from a previous session.entry-type
is :all or the ID of some entry type.Returns [`entry-id`, ...] for `entry-type` in `g` ordered by :glog/executionOrder Where - `entry-id` is a KWI identifying a log event in `g` - `g` is an optional IGraph supporting the logging ontology, (default log-graph) This is typically either the current log-graph or a copy of the log-grpah from a previous session. - `entry-type` is :all or the ID of some entry type.
(entry-count)
(entry-count g)
Returns the number of entries in g
(default @log-graph)
Returns the number of entries in `g` (default @log-graph)
(find-divergence log1 log2)
Returns [same> [
e1> e2>] for
log1and
log2`
Where
same> := [
shared-event>, ...]e1>,
e2> name events whose details differ between log1> and
log2>log1>
log2> are @log-graph's from two different sessions,
typically reflecting some minor change in the same code base.Returns [`same> [`e1> `e2>] for `log1` and `log2` Where - `same> := [`shared-event>, ...] - `e1>, `e2> name events whose details differ between `log1> and `log2> - `log1> `log2> are @log-graph's from two different sessions, typically reflecting some minor change in the same code base.
(ith-entry i)
(ith-entry g i)
Returns [entry-id
description
] for ith execution order in g
(default @graph-log)
Where
entry-id
is keyword naming the entrydescription
is the normal-form description of entry-id
in g
g
is a log-graph (@log-graph by default)Returns [`entry-id` `description`] for ith execution order in `g` (default @graph-log) Where - `entry-id` is keyword naming the entry - `description` is the normal-form description of `entry-id` in `g` - `g` is a log-graph (@log-graph by default)
Caches level priorities, to inform level>=
Caches level priorities, to inform `level>=`
(level>= this-level that-level)
Returns true iff this-level
has priority >= that-level
Where
<this-level> e.g. :glog/INFO
<that-level> e.g. :glog/DEBUG
Returns true iff `this-level` has priority >= `that-level` Where <this-level> e.g. :glog/INFO <that-level> e.g. :glog/DEBUG
(log! entry-type & args)
Side-effect: adds an entry to log-graph for id
minted per entry-type
and args
Returns: id
or nil (if no entry was made)
Where
id
is a KWI minted for entry-type
and whatever arg-kwi
s are of
:rdf/type :glog/InformsUri in @log-graph.entry-type
is a KWIargs
:= [arg-kwi
value
, ...]
Note: Any issues relating to log levels should be handled before calling this
function.Side-effect: adds an entry to log-graph for `id` minted per `entry-type` and `args` Returns: `id` or nil (if no entry was made) Where - `id` is a KWI minted for `entry-type` and whatever `arg-kwi`s are of :rdf/type :glog/InformsUri in @log-graph. - `entry-type` is a KWI - `args` := [`arg-kwi` `value`, ...] Note: Any issues relating to log levels should be handled before calling this function.
(log-reset!)
(log-reset! initial-graph)
Side-effect: resets @log-graph to initial-graph
Where
Side-effect: resets @log-graph to `initial-graph` Where - <initial-graph> is an IGraph, informed by ont-app.graph-log.core/ontology - optional. Default is core/ontology.
(log-value! entry-type value)
(log-value! entry-type other-args value)
Returns value
Side effect: logs <id> :glog/value value
, plus other-args
into log-graph
Where
entry-type
is a keyword naming the type of entry
value
is the value being logged before it's returned.other-args
:= [p
o
, ...]entry
is an entry in @glog/log-graphp
is a keyword naming a property of entry
o
is a value asserted for p
s.t. [entry
p
o
] in the log.Returns `value` Side effect: logs <id> :glog/value `value`, plus `other-args` into log-graph Where - `entry-type` is a keyword naming the type of `entry` - `value` is the value being logged before it's returned. - `other-args` := [`p` `o`, ...] - `entry` is an entry in @glog/log-graph - `p` is a keyword naming a property of `entry` - `o` is a value asserted for `p` s.t. [`entry` `p` `o`] in the log.
(query-log q)
(query-log g q)
Returns [bmap
, ....] for q
posed to optional g
Where
bmap
:= {var
value
, ...} bindings to q
posed to g
q
is a query in a format amenable to g
g
is an IGraph supporting the graph-log vocabulary (default @log-graph)Returns [`bmap`, ....] for `q` posed to optional `g` Where - `bmap` := {`var` `value`, ...} bindings to `q` posed to `g` - `q` is a query in a format amenable to `g` - `g` is an IGraph supporting the graph-log vocabulary (default @log-graph)
(remove-timestamps)
(remove-timestamps g)
Spurious difference between two logs
Spurious difference between two logs
(remove-variant-values)
(remove-variant-values g)
Returns g
, removing/replacing values which would naturally vary between sessions.
These would give rise to spurious differences between two otherwise identical
logs. Timestamps are removed, and compiled objects are replaced with
:compiled
Where
g
is an optional log-graph from the current or past sessions. Default
is current @log-graphReturns `g`, removing/replacing values which would naturally vary between sessions. These would give rise to spurious differences between two otherwise identical logs. Timestamps are removed, and compiled objects are replaced with :compiled Where - `g` is an optional log-graph from the current or past sessions. Default is current @log-graph
(search inc-or-dec entry-test g c found q)
Returns [c found [previous-index]] for entry-test
of i
th entry per q
and inc-or-dec
See also the IGraph docs for traversal functions.
Where
c
is the (ignored) traversal contextfound
is nil or the first previous entry to pass test
previous-index
decrements the head of q
, or empty if found or i
< 0entry-test
:= fn [g entry] -> booleanq
:= [entry
or i
[i] if still searching or [] if found. inc/dec-ing
per iterationi
is the execution order to testinc-or-dec
:~ #{inc dec}, inc to search forward dec to search backward.entry
is the i
th entry in g
g
is a log-graph.test
(igraph/traverse log
(partial search-backward test
)
nil
[entry-id
])Returns [c found [previous-index]] for `entry-test` of `i`th entry per `q` and inc-or-dec See also the IGraph docs for traversal functions. Where - `c` is the (ignored) traversal context - `found` is nil or the first previous entry to pass `test` - `previous-index` decrements the head of `q`, or empty if found or `i` < 0 - `entry-test` := fn [g entry] -> boolean - `q` := [`entry` or `i` [i] if still searching or [] if found. inc/dec-ing per iteration - `i` is the execution order to test - `inc-or-dec` :~ #{inc dec}, inc to search forward dec to search backward. - `entry` is the `i`th entry in `g` - `g` is a log-graph. - NOTE: typically this is used as a partial application over `test` (igraph/traverse `log` (partial search-backward `test`) nil [`entry-id`])
(search-backward test)
(search-backward test start)
(search-backward g test start)
Searches the log backward for a match to test
, starting at start
Where
test
:= fn [g entry] -> booleanstart
is an integer indexing the (entries g) (default end of entries)g
is the log-graphSearches the log backward for a match to `test`, starting at `start` Where - `test` := fn [g entry] -> boolean - `start` is an integer indexing the (entries g) (default end of entries) - `g` is the log-graph
(search-forward test)
(search-forward test start)
(search-forward g test start)
Searches the log forward for a match to test
starting at start
Where
test
:= fn [g entry] -> booleanstart
is an integer indexing (entries g) (default 0)g
is the log-graphSearches the log forward for a match to `test` starting at `start` Where - `test` := fn [g entry] -> boolean - `start` is an integer indexing (entries g) (default 0) - `g` is the log-graph
(set-level! element level)
Side-effect, adds args
to entry for element
in log-graph
Where
args
:= [predicate
object
, ...]element
is an element of the log-graphSide-effect, adds `args` to entry for `element` in log-graph Where - `args` := [`predicate` `object`, ...] - `element` is an element of the log-graph
(show entry-id)
(show entry-id p)
(show entry-id p o)
Returns contents of entry-id
for optional g
Where
entry-id
is the KWI of an entryg
is a log-graph (default @log-graph)Returns contents of `entry-id` for optional `g` Where - `entry-id` is the KWI of an entry - `g` is a log-graph (default @log-graph)
(std-logging-message & args)
Returns: a string suitable for standard logging based on args
, or nil
if there is no :glog/message specification.
Where
args
:= {p
o
, ....}p
is a keyword naming a property, possibly :glog/messageo
is a value, known as template
if p
= :glog/messagetemplate
is a mustache-style template to which desc-map
will be applied
Of the form `yadda {{<p>}} yadda...'desc-map
:= {p
o
, ...}, minus any :glog/message. Specifying o
's to be
inserted into template
.Returns: a string suitable for standard logging based on `args`, or nil if there is no :glog/message specification. Where - `args` := {`p` `o`, ....} - `p` is a keyword naming a property, possibly :glog/message - `o` is a value, known as `template` if `p` = :glog/message - `template` is a mustache-style template to which `desc-map` will be applied Of the form `yadda {{<p>}} yadda...' - `desc-map` := {`p` `o`, ...}, minus any :glog/message. Specifying `o`'s to be inserted into `template`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close