Retrieves the root logger instance.
The root logger with empty category
Retrieves a logger for the specified file path or URL.
Extracts a hierarchical category array from the path for logger categorisation.
Automatically configures LogTape on first use if the extracted category starts
with "/" (local code) and LogTape is not yet configured. Default configuration
includes console sink with visual severity prefixes, LogTape meta logger set to
"warning" level, and local code logger at "info" level.
Path resolution:
Local code (your project): Category starts with "/", followed by the package
directory (the folder enclosing src/) and the segments after src/. If a URL is
provided (for instance, import.meta.url), its pathname is parsed; when src/ is absent
the filename only is used and the package directory is omitted. Extensions are removed;
"index" is preserved as an explicit segment so that name.ts and name/index.ts remain
distinguishable. The package directory keeps modules from sibling packages in a monorepo distinct.
Imported packages (from node_modules/): Non-scoped packages start with the bare
package name (for instance, ["lodash", "index"] for a bare entry point); scoped
packages use two segments (for instance, ["@metreeca", "post", "index"]).
Build directories (dist, lib, build, out) and redundant package name
folders are skipped. Extensions are removed from remaining paths; "index" is
preserved. Hierarchical matching means a filter at lodash still applies to
lodash/index.
File path or URL to create logger category from
Logger instance for the resolved category
Retrieves a logger for the specified category array.
Automatically configures LogTape on first use if the category starts with "/"
and LogTape is not yet configured. Default configuration includes console sink
with visual severity prefixes, LogTape meta logger at "warning" level, and
local code logger at "info" level.
Hierarchical logger category segments
Logger instance for the specified category
Wraps a synchronous function with error handling and logging.
Catches errors thrown by the function, logs them using the function's name
as logger category, and returns undefined instead of propagating the error.
The tuple type of function arguments
The return type of the function
Wrapped function that returns the original result or undefined on error
Configures LogTape with a complete configuration object.
Repeated calls with a deep-equal configuration are silently accepted (the reset flag is ignored
for comparison purposes). Applying a different configuration throws unless reset is set to true.
Sink identifier type
Filter identifier type
Configures LogTape with category-to-level mappings.
Configures LogTape with a single console logger using visual severity prefixes and a configuration derived from a simplified representation mapping categories to minimum log levels:
Each key represents a LogTape category in label form: "/" (all internal code), "/utils"
(internal module), "lodash" (non-scoped package), "@scope/pkg" (scoped package). A
trailing / targets the index module (for instance, "/name/" matches only src/name/index.ts).
Each value specifies the minimum LogLevel for the category.
Repeated calls with a deep-equal mapping are silently accepted. Applying a different configuration
throws unless a full Config object with reset set to true is used.
Path-to-level mapping for logger configuration
Wraps an asynchronous function with error handling and logging.
Catches errors thrown or rejected by the function, logs them using the
function's name as logger category, and returns undefined instead of
propagating the error.
The tuple type of function arguments
The return type of the function
Wrapped function that returns a promise resolving to the original result or undefined on error
Retrieves loggers, configures LogTape, and guards functions.