console

package
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ModuleName = "console"

Variables

This section is empty.

Functions

func Enable

func Enable(runtime *goja.Runtime)

func Require

func Require(runtime *goja.Runtime, module *goja.Object)

func RequireWithPrinter

func RequireWithPrinter(printer Printer) require.ModuleLoader

Types

type Console

type Console struct {
	// contains filtered or unexported fields
}

type LogPrinter

type LogPrinter struct {
}

LogPrinter implements the console.Printer interface that prints to the stdout or stderr.

func (LogPrinter) Debug

func (p LogPrinter) Debug(s ...interface{})

Debug prints s to the stderr.

func (LogPrinter) Error

func (p LogPrinter) Error(s ...interface{})

Error prints s to the stderr.

func (LogPrinter) Log

func (p LogPrinter) Log(s ...interface{})

Log prints s to the stdout.

func (LogPrinter) Warn

func (p LogPrinter) Warn(s ...interface{})

Warn prints s to the stderr.

type Printer

type Printer interface {
	Log(v ...interface{})
	Warn(v ...interface{})
	Error(v ...interface{})
	Debug(v ...interface{})
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL