Structured logging
Your Runnable code can log to Atmo's structured output using the logging methods.
- Rust
- JavaScript/TypeScript
- AssemblyScript
In Rust these methods are available under the log
module:
# Use the "log" module
use suborbital::log;
# Invoke the "Info" method
log::info(…)
In JavaScript and TypeScript the methods live on the log
import:
import { log } from "@suborbital/runnable"
log.info(…)
In AssemblyScript all methods are prefixed with log
:
// Import then invoke "Info" method
import { reqInfo } from '@suborbital/suborbital'
logInfo(…)
The following namespace methods are available:
Info
Logs the message with the 'info' level:
- Rust
- JavaScript & TypeScript
- AssemblyScript
STATUS: STABLE
pub fn info(msg: &str)
STATUS: BETA
log.info(message: string): void
STATUS: BETA
function logInfo(msg: string): void
Warn
Logs the message with the 'warn' level:
- Rust
- JavaScript & TypeScript
- AssemblyScript
STATUS: STABLE
pub fn warn(msg: &str)
STATUS: BETA
log.warn(message: string): void
STATUS: BETA
function logWarn(msg: string): void
Error
Logs the message with the 'err' level:
- Rust
- JavaScript & TypeScript
- AssemblyScript
STATUS: STABLE
pub fn error(msg: &str)
STATUS: BETA
log.error(message: string): void
STATUS: BETA
function logErr(msg: string): void
Debug
Logs the message with the 'debug' level:
- Rust
- JavaScript & TypeScript
- AssemblyScript
STATUS: STABLE
pub fn debug(msg: &str)
STATUS: BETA
log.debug(message: string): void
STATUS: BETA
function logDebug(msg: string): void