Clear Paniclog Method
The clearPaniclog method removes all persisted panic records.
Using TypeScript
For TypeScript, call .clearPaniclog() on a VM configured with the Debug capability. The method returns after the records are removed and throws an error if the operation fails.
ts
import { Capability, LightVM } from 'lightvm';
const vm = new LightVM({ caps: [Capability.Debug] });
vm.clearPaniclog();Using Rust
In Rust, call .clear_paniclog() on a VM configured with the Debug capability. The method returns Result<(), VMError>.
rust
use lightvm::LightVM;
use lightvm::types::{capability::Capability, vmconfig::VmConfig};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let vm = LightVM::new(VmConfig {
caps: vec![Capability::Debug],
..Default::default()
});
vm.clear_paniclog()?;
Ok(())
}INFO
Capability Required: Debug
WARNING
The .clearPaniclog() and .clear_paniclog() methods are unavailable in WebAssembly builds.