Skip to content

Commit f3fc0fe

Browse files
committed
Fix Threads import for package precompilation
1 parent 77a3412 commit f3fc0fe

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

‎docs/src/functions.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ CurrentModule = ComponentLogging
44

55
# Function API
66

7-
This page documents the **function-first** logging APIs exported by `ComponentLogging`.
8-
All functions require the logger to be passed explicitly as the first argument.
9-
In application code you will typically define *forwarding helpers* to avoid threading the logger manually.
7+
This page documents the function-based logging interface exported by `ComponentLogging`.
108

11-
When you already have a logger available (e.g. stored in a `const` or a `Ref`), calling `clog(logger, ...)` bypasses the task-local logger lookup performed by stdlib logging macros (`@info`, `@logmsg`, …) and can reduce overhead in hot paths.
9+
These functions take a logger explicitly as their first argument. In application code, `@forward_logger` can generate forwarding methods when repeatedly passing the same logger would be inconvenient.
10+
11+
When a logger is already available, for example in a `const` or `Ref`, calling `clog(logger, ...)` avoids the module-registry lookup used by the logging macros and can reduce overhead in frequently executed code.
1212

1313
## Forwarding macro
1414

‎docs/src/macros.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ CurrentModule = ComponentLogging
44

55
# Macros API
66

7-
This page documents the **macro-first** logging APIs exported by `ComponentLogging`.
7+
This page documents the logging macros exported by `ComponentLogging`.
88

9-
Macros work differently from functions. Macros do not take a logger as an argument; instead, you need to bind a key-value pair of `current module => logger` to the internal module registry of ComponentLogging.
10-
Subsequent macro calls do not require passing the logger; the logger for the current module is retrieved via a dictionary lookup.
9+
Unlike the function API, the macros do not take a logger explicitly. Instead, a logger is associated with a module in the internal module registry. Each macro call retrieves the logger bound to the calling module, falling back through its parent modules when necessary.
1110

1211
You can use `set_module_logger` or `@bind_logger` in the `__init__` function to bind the logger to the current module.
1312

‎src/ComponentLogging.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module ComponentLogging
22
using Logging
3-
using Threads: Atomic
3+
using Base.Threads: Atomic
44

55
include("PlainLogger.jl")
66
export PlainLogger

0 commit comments

Comments
 (0)