Files
Basalt/docs/docs1_6/objects/Basalt/log.md
Robert Jelic d4c72514ef Docs 1.6
Accidentally uploaded outdated 1.6 docs
2023-05-01 16:28:46 +02:00

865 B

Basalt

log

This writes something into a file. The main goal is to make debugging errors easier. Lets say you'r program is crashing and you don't know why, you could use basalt.log The log files will automatically removed after you start your program again.

Parameters

  1. string The text to write into the log file
  2. string - optional (default: "Debug") - the type to write

Usage

  • Writes "Hello!" into the log file
basalt.log("Hello!")

This should result in there beeing a file called basaltLog.txt. In the file it should say [Basalt][Debug]: Hello!.

  • Writes "Config file missing" into the log file, with warning as prefix.
basalt.log("Config file is missing", "WARNING")

This should result in there beeing a file called basaltLog.txt. In the file it should say [Basalt][WARNING]: Config file is missing.