<p dir="auto">I've copied the code in question from logging.jl here:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="_log_record_ids = Set{Symbol}()
# Generate a unique, stable, short, human readable identifier for a logging
# statement.  The idea here is to have a key against which log records can be
# filtered and otherwise manipulated. The key should uniquely identify the
# source location in the originating module, but should be stable across
# versions of the originating module, provided the log generating statement
# itself doesn't change.
function log_record_id(_module, level, message_ex)
    modname = _module === nothing ?  &quot;&quot; : join(fullname(_module), &quot;_&quot;)
    # Use (1&lt;&lt;31) to fit well within an (arbitriraly chosen) eight hex digits,
    # as we increment h to resolve any collisions.
    h = hash(string(modname, level, message_ex)) % (1&lt;&lt;31)
    while true
        id = Symbol(modname, '_', string(h, base = 16, pad = 8))
        # _log_record_ids is a registry of log record ids for use during
        # compilation, to ensure uniqueness of ids.  Note that this state will
        # only persist during module compilation so it will be empty when a
        # precompiled module is loaded.
        if !(id in _log_record_ids)
            push!(_log_record_ids, id)
            return id
        end
        h += 1
    end
end"><pre class="notranslate">_log_record_ids <span class="pl-k">=</span> <span class="pl-c1">Set</span><span class="pl-c1">{Symbol}</span>()
<span class="pl-c"><span class="pl-c">#</span> Generate a unique, stable, short, human readable identifier for a logging</span>
<span class="pl-c"><span class="pl-c">#</span> statement.  The idea here is to have a key against which log records can be</span>
<span class="pl-c"><span class="pl-c">#</span> filtered and otherwise manipulated. The key should uniquely identify the</span>
<span class="pl-c"><span class="pl-c">#</span> source location in the originating module, but should be stable across</span>
<span class="pl-c"><span class="pl-c">#</span> versions of the originating module, provided the log generating statement</span>
<span class="pl-c"><span class="pl-c">#</span> itself doesn't change.</span>
<span class="pl-k">function</span> <span class="pl-en">log_record_id</span>(_module, level, message_ex)
    modname <span class="pl-k">=</span> _module <span class="pl-k">===</span> <span class="pl-c1">nothing</span> <span class="pl-k">?</span>  <span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span> <span class="pl-k">:</span> <span class="pl-c1">join</span>(<span class="pl-c1">fullname</span>(_module), <span class="pl-s"><span class="pl-pds">"</span>_<span class="pl-pds">"</span></span>)
    <span class="pl-c"><span class="pl-c">#</span> Use (1&lt;&lt;31) to fit well within an (arbitriraly chosen) eight hex digits,</span>
    <span class="pl-c"><span class="pl-c">#</span> as we increment h to resolve any collisions.</span>
    h <span class="pl-k">=</span> <span class="pl-c1">hash</span>(<span class="pl-c1">string</span>(modname, level, message_ex)) <span class="pl-k">%</span> (<span class="pl-c1">1</span><span class="pl-k">&lt;&lt;</span><span class="pl-c1">31</span>)
    <span class="pl-k">while</span> <span class="pl-c1">true</span>
        id <span class="pl-k">=</span> <span class="pl-c1">Symbol</span>(modname, <span class="pl-s"><span class="pl-pds">'</span>_<span class="pl-pds">'</span></span>, <span class="pl-c1">string</span>(h, base <span class="pl-k">=</span> <span class="pl-c1">16</span>, pad <span class="pl-k">=</span> <span class="pl-c1">8</span>))
        <span class="pl-c"><span class="pl-c">#</span> _log_record_ids is a registry of log record ids for use during</span>
        <span class="pl-c"><span class="pl-c">#</span> compilation, to ensure uniqueness of ids.  Note that this state will</span>
        <span class="pl-c"><span class="pl-c">#</span> only persist during module compilation so it will be empty when a</span>
        <span class="pl-c"><span class="pl-c">#</span> precompiled module is loaded.</span>
        <span class="pl-k">if</span> <span class="pl-k">!</span>(id <span class="pl-k">in</span> _log_record_ids)
            <span class="pl-c1">push!</span>(_log_record_ids, id)
            <span class="pl-k">return</span> id
        <span class="pl-k">end</span>
        h <span class="pl-k">+=</span> <span class="pl-c1">1</span>
    <span class="pl-k">end</span>
<span class="pl-k">end</span></pre></div>
<p dir="auto">Note that it will loop the number of times the log has previously been logged. This makes benchmarking logging very difficult, as this function takes up almost the entire runtime.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; function xparse4(str)
           @debug &quot;xparse&quot;
           Base.parse(Int, str)
       end

julia&gt; @benchmark @suppress xparse4(&quot;0&quot;)
BenchmarkTools.Trial:
  memory estimate:  1.20 MiB
  allocs estimate:  22514
  --------------
  minimum time:     2.856 ms (0.00% GC)
  median time:      3.752 ms (0.00% GC)
  mean time:        3.979 ms (4.19% GC)
  maximum time:     51.694 ms (92.27% GC)
  --------------
  samples:          1255
  evals/sample:     1"><pre class="notranslate"><code class="notranslate">julia&gt; function xparse4(str)
           @debug "xparse"
           Base.parse(Int, str)
       end

julia&gt; @benchmark @suppress xparse4("0")
BenchmarkTools.Trial:
  memory estimate:  1.20 MiB
  allocs estimate:  22514
  --------------
  minimum time:     2.856 ms (0.00% GC)
  median time:      3.752 ms (0.00% GC)
  mean time:        3.979 ms (4.19% GC)
  maximum time:     51.694 ms (92.27% GC)
  --------------
  samples:          1255
  evals/sample:     1
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; results = @benchmark Base.CoreLogging.log_record_id(@__MODULE__, :Debug, :(&quot;xparse&quot;))
BenchmarkTools.Trial:
  memory estimate:  1.04 MiB
  allocs estimate:  24700
  --------------
  minimum time:     2.852 ms (0.00% GC)
  median time:      4.141 ms (0.00% GC)
  mean time:        4.366 ms (2.64% GC)
  maximum time:     46.329 ms (90.08% GC)
  --------------
  samples:          1143
  evals/sample:     1"><pre class="notranslate"><code class="notranslate">julia&gt; results = @benchmark Base.CoreLogging.log_record_id(@__MODULE__, :Debug, :("xparse"))
BenchmarkTools.Trial:
  memory estimate:  1.04 MiB
  allocs estimate:  24700
  --------------
  minimum time:     2.852 ms (0.00% GC)
  median time:      4.141 ms (0.00% GC)
  mean time:        4.366 ms (2.64% GC)
  maximum time:     46.329 ms (90.08% GC)
  --------------
  samples:          1143
  evals/sample:     1
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; lineplot(StatsBase.trim(results.times; count=10))
           ┌────────────────────────────────────────┐
   8000000 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡼⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡞⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠴⠚⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡤⠴⠚⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⣀⡤⠴⠒⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⢀⡤⠖⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
   3000000 │⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           └────────────────────────────────────────┘
           0                                     2000"><pre class="notranslate"><code class="notranslate">julia&gt; lineplot(StatsBase.trim(results.times; count=10))
           ┌────────────────────────────────────────┐
   8000000 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡼⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡞⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠴⠚⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡤⠴⠚⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⣀⡤⠴⠒⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⢀⡤⠖⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
   3000000 │⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           └────────────────────────────────────────┘
           0                                     2000
</code></pre></div>
<p dir="auto">Do we even need this function? Could we just have logs not have ids unless they're explicitly provided? Where are these ids being used?</p>
<p dir="auto">As discussed on discourse <a href="https://discourse.julialang.org/t/custom-updating-binary-operator/29301" rel="nofollow">https://discourse.julialang.org/t/custom-updating-binary-operator/29301</a></p>
<p dir="auto">Would there be interest in adding support for other updating binary operators?</p>
<p dir="auto">For example, it would be nice to be able to write <code class="notranslate">a ∪= b</code></p>
<p dir="auto">Aside from set union and intersection, are there any other candidates?</p>