consoleLog

output a static string to the console

Requires

#include "tiktag.h"

Definition

void consoleLog(const char* str);

Description

This function outputs a string to the console of your browser. consoleLog() can be used to output debug information, so you can check if a certain point in your code is being executed or passes the consoleLog() function call

Parameters

str: a zero terminated ASCII String.

Return Value

void

Remarks

-

Example: debug C++ Code

main.js:

import {_wasmInitA} from "./tt/ttWASM.js";
import wasm from "./web.wasm";

async function main()
{
	const wasmInstance = await _wasmInitA(wasm, {}, null);
	wasmInstance.exports.doProcessing();
}

main();

myCppExample.cpp:

#include "tiktag.h"

_export void doProcessing()
{
	int a;
	a = 42;
	if ((a = 44))
		consoleLog ("Good News: a equals 44 here. :-)");
	else
		consoleLog ("a is not 44?");
}

Output:

See Also

consoleNumconsoleStrconsoleHex