Structured logging
Your Runnable code can log to Atmo's structured output using the logging methods.
- Rust
- JavaScript/TypeScript 🧪
- AssemblyScript 🧪
- Swift 🧪
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(…)
In Swift these methods are prefixed with Log
:
// Invoke the "Info" method
Suborbital.LogInfo(…)
The following namespace methods are available:
Info​
Logs the message with the 'info' level:
- Rust
- JavaScript & TypeScript
- AssemblyScript
- Swift
STATUS: STABLE
pub fn info(msg: &str)
STATUS: BETA
log.info(message: string): void
STATUS: BETA
function logInfo(msg: string): void
STATUS: PREVIEW
public func LogInfo(msg: String)
Warn​
Logs the message with the 'warn' level:
- Rust
- JavaScript & TypeScript
- AssemblyScript
- Swift
STATUS: STABLE
pub fn warn(msg: &str)
STATUS: BETA
log.warn(message: string): void
STATUS: BETA
function logWarn(msg: string): void
STATUS: PREVIEW
public func LogWarn(msg: String)
Error​
Logs the message with the 'err' level:
- Rust
- JavaScript & TypeScript
- AssemblyScript
- Swift
STATUS: STABLE
pub fn error(msg: &str)
STATUS: BETA
log.error(message: string): void
STATUS: BETA
function logErr(msg: string): void
STATUS: PREVIEW
public func LogErr(msg: String)
Debug​
Logs the message with the 'debug' level:
- Rust
- JavaScript & TypeScript
- AssemblyScript
- Swift
STATUS: STABLE
pub fn debug(msg: &str)
STATUS: BETA
log.debug(message: string): void
STATUS: BETA
function logDebug(msg: string): void
STATUS: PREVIEW
public func LogDebug(msg: String)