Skip to content
Tauri 中文网

@tauri-apps/plugin-log

Interfaces

LogOptions

Properties

PropertyTypeDefined in
file?stringSource: undefined
keyValues?Record<string, undefined | string>Source: undefined
line?numberSource: undefined

Functions

attachConsole()

function attachConsole(): Promise<UnlistenFn>

Attaches a listener that writes log entries to the console as they come in.

Returns

Promise<UnlistenFn>

a function to cancel the listener.

Source: undefined


attachLogger()

function attachLogger(fn): Promise<UnlistenFn>

Attaches a listener for the log, and calls the passed function for each log entry.

Parameters

ParameterTypeDescription
fnLoggerFn

Returns

Promise<UnlistenFn>

a function to cancel the listener.

Source: undefined


debug()

function debug(message, options?): Promise<void>

Logs a message at the debug level.

Parameters

ParameterTypeDescription
messagestring# Examples import { debug } from '@tauri-apps/plugin-log'; const pos = { x: 3.234, y: -1.223 }; debug(New position: x: {pos.x}, y: {pos.y});
options?LogOptions-

Returns

Promise<void>

Source: undefined


error()

function error(message, options?): Promise<void>

Logs a message at the error level.

Parameters

ParameterTypeDescription
messagestring# Examples import { error } from '@tauri-apps/plugin-log'; const err_info = "No connection"; const port = 22; error(Error: ${err_info} on port ${port});
options?LogOptions-

Returns

Promise<void>

Source: undefined


info()

function info(message, options?): Promise<void>

Logs a message at the info level.

Parameters

ParameterTypeDescription
messagestring# Examples import { info } from '@tauri-apps/plugin-log'; const conn_info = { port: 40, speed: 3.20 }; info(Connected to port {conn_info.port} at {conn_info.speed} Mb/s);
options?LogOptions-

Returns

Promise<void>

Source: undefined


trace()

function trace(message, options?): Promise<void>

Logs a message at the trace level.

Parameters

ParameterTypeDescription
messagestring# Examples import { trace } from '@tauri-apps/plugin-log'; let pos = { x: 3.234, y: -1.223 }; trace(Position is: x: {pos.x}, y: {pos.y});
options?LogOptions-

Returns

Promise<void>

Source: undefined


warn()

function warn(message, options?): Promise<void>

Logs a message at the warn level.

Parameters

ParameterTypeDescription
messagestring# Examples import { warn } from '@tauri-apps/plugin-log'; const warn_description = "Invalid Input"; warn(Warning! {warn_description}!);
options?LogOptions-

Returns

Promise<void>

Source: undefined


Tauri 中文网 - 粤ICP备13048890号