(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
)VOCABULARY:
<log graph> :glog/archiveDirectory
<directory>
<log graph> :glog/archivePathFn
<path fn kw>
<path fn kw> :igraph/compiledAs
<fn [g] -> directory>
True iff archiving is enabled for `g` Where: - `g` is an IGraph being used as a log-graph (default [[log-graph]]) VOCABULARY: <log graph> `:glog/archiveDirectory` <directory> <log graph> `:glog/archivePathFn` <path fn kw> <path fn kw> `:igraph/compiledAs` <fn [g] -> directory>
(clear-entries g)
Returns g
with all entries removed
VOCABULARY:
:glog/LogGraph
:glog/hasEntry
<entry>
Returns `g` with all entries removed VOCABULARY: `:glog/LogGraph` `:glog/hasEntry` <entry>
(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.
Atom containing default log level. Initialized to :glog/INFO.
Atom containing default log level. Initialized to :glog/INFO.
An instance of an empty native-normal graph.
An instance of an empty native-normal graph.
(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.VOCABULARY
:glog/LogGraph
- Names @log-graph in @log-graph:glog/hasEntry
<entry>:glog/executionOrder
<int representing that entry is ith event executed>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. VOCABULARY - `:glog/LogGraph` - Names @log-graph in @log-graph - <log graph> `:glog/hasEntry` <entry> - <entry> `:glog/executionOrder` <int representing that entry is ith event executed>
(entry-count)
(entry-count g)
Returns the number of entries in g
(default @log-graph)
VOCABULARY:
:Glog/LogGraph
:glog/entryCount
<# of entries>
Returns the number of entries in `g` (default @log-graph) VOCABULARY: `:Glog/LogGraph` `:glog/entryCount` <# of entries>
(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,
NOTE: typically called during debugging 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, NOTE: typically called during debugging 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.VOCABULARY
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. VOCABULARY - :glog/InformsUri - type for a property referred to when minting URIs - :glog/Entry - type for log entries - :glog/LogGraph - Names @log-graph in @log-graph - <log graph> :glog/entryCount <number of entries in the graph> - <log graph> :glog/hasEntry <entry> - <entry> :glog/timestamp <time of event in epoch ms> - <entry> :glog/executionOrder <int representing that entry is ith event executed>
An atom holding the current graph to which new entries will be logged.
An atom holding the current graph to which new entries will be logged.
(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.VOCABULARY
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. VOCABULARY - <entry> :glog/value <value of some eval'd expression>
A native-normal graph containing the graph-log ontology
A native-normal graph containing the graph-log ontology
(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)
Removes timestamps, a spurious difference between two otherwise equivalent log entries.
NOTE: typically used to compare two otherwise identical logs.
VOCABULARY:
:glog/LogGraph
- Names @log-graph in @log-graph:glog/hasEntry
<entry>:glog/timestamp
<time of event in epoch ms>Removes timestamps, a spurious difference between two otherwise equivalent log entries. NOTE: typically used to compare two otherwise identical logs. VOCABULARY: - `:glog/LogGraph` - Names @log-graph in @log-graph - <log graph> `:glog/hasEntry` <entry> - <entry> `:glog/timestamp` <time of event in epoch ms>
(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.search-forward
or search-backward
which wrap this fn.test
(igraph/traverse g
(partial search-backward test
)
nil
[entry-id
])VOCABULARY
:glog/executionOrder
<int indicating event is ith event executed>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 we'd use `search-forward` or `search-backward` which wrap this fn. - NOTE: typically this is used as a partial application over `test` (igraph/traverse `g` (partial search-backward `test`) nil [`entry-id`]) VOCABULARY - <entry> `:glog/executionOrder` <int indicating event is ith event executed>
(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! level)
(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-graphVOCABULARY:
:glog/level
<level>Side-effect, adds `args` to entry for `element` in log-graph Where - `args` := [`predicate` `object`, ...] - `element` is an element of the log-graph VOCABULARY: - <log-graph or entry> `:glog/level` <level>
(show entry-id)
(show entry-id p)
(show entry-id p o)
Returns contents of entry-id
for optional g
p
and o
Where
entry-id
is the KWI of an entryg
is a log-graph (default @log-graph)p
specifies a property of the entryo
tests for a specific objectReturns contents of `entry-id` for optional `g` `p` and `o` Where - `entry-id` is the KWI of an entry - `g` is a log-graph (default @log-graph) - `p` specifies a property of the entry - `o` tests for a specific object
(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
.VOCABULARY:
<entry> :glog/message
<message mustache 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`. VOCABULARY: <entry> `:glog/message` <message mustache template>
(timestamp)
Returns the timestamp associated with the current moment in epoch ms.
Returns the timestamp associated with the current moment in epoch ms.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close