Skip to content
Tauri
Releases

@tauri-apps/plugin-log

Type Aliases

LogOptions

LogOptions: object;

Type declaration

MemberType
file?string
keyValues?Record< string, string | undefined >
line?number

Source: index.ts:9

Functions

attachConsole()

attachConsole(): Promise< UnlistenFn >

Returns

Promise< UnlistenFn >

Source: index.ts:192


debug()

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

Logs a message at the debug level.

Parameters

ParameterTypeDescription
messagestring# Examples

js 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: index.ts:158


error()

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

Logs a message at the error level.

Parameters

ParameterTypeDescription
messagestring# Examples

js 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: index.ts:92


info()

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

Logs a message at the info level.

Parameters

ParameterTypeDescription
messagestring# Examples

js 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: index.ts:136


trace()

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

Logs a message at the trace level.

Parameters

ParameterTypeDescription
messagestring# Examples

js 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: index.ts:180


warn()

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

Logs a message at the warn level.

Parameters

ParameterTypeDescription
messagestring# Examples

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

Returns

Promise< void >

Source: index.ts:114


© 2024 Tauri Contributors. CC-BY / MIT