Modules@robinpath/log
@robinpath/log
0.1.1PublicStructured logging with levels, file output, JSON format, timers, and grouping
@robinpath/log
Structured logging with levels, file output, JSON format, timers, and grouping
Why use this module?
The log module lets you:
- Log a message at DEBUG level to stdout
- Log a message at INFO level to stdout
- Log a message at WARN level to stderr
- Log a message at ERROR level to stderr
- Log a message at FATAL level to stderr
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
npm install @robinpath/log
Quick Start
No credentials needed — start using it right away:
log.info "Server started on port" $port
Available Functions
| Function | Description |
|---|---|
log.debug | Log a message at DEBUG level to stdout |
log.info | Log a message at INFO level to stdout |
log.warn | Log a message at WARN level to stderr |
log.error | Log a message at ERROR level to stderr |
log.fatal | Log a message at FATAL level to stderr |
log.setLevel | Set the minimum log level; messages below this level are suppressed |
log.getLevel | Get the current minimum log level as a string |
log.setFile | Set a file path to append log output to in addition to stdout/stderr |
log.setFormat | Set the output format for log messages |
log.clear | Reset all log settings to defaults (info level, no file, text format) |
log.table | Pretty-print an array of objects as a table to stdout |
log.group | Print a group header and increase indentation for subsequent log messages |
log.groupEnd | End the current group and decrease indentation |
log.time | Start a named timer |
log.timeEnd | Stop a named timer and log the elapsed time in milliseconds |
Examples
Log a message at INFO level to stdout
log.info "Server started on port" $port
Log a message at WARN level to stderr
log.warn "Deprecated function called"
Log a message at ERROR level to stderr
log.error "Failed to connect:" $err
Integration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/log";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
log.info "Server started on port" $port
`);
Full API Reference
See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.
Related Modules
@robinpath/json— JSON module for complementary functionality
License
MIT
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.1 | latest | yesterday |
Related Modules
utilities
1
@dev-tester/hello-world
v2.0.0dev-tester
Updated description
0 downloads
...
utilities
0
@robinpath/apollo
v0.1.1robinpath
Apollo module for RobinPath.
0 downloads
...
utilities
0
@robinpath/archive
v0.1.1robinpath
Create and extract .zip and .tar.gz file archives
0 downloads
...
utilities
0
@robinpath/assert
v0.1.1robinpath
Testing assertions: equal, deepEqual, truthy, falsy, type checks, includes, matches, throws, and more
0 downloads
...
Install
$ robinpath install @robinpath/log Version0.1.1
LicenseMIT
Unpacked Size5.7 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

