log.jamo (built in)

log: messages with levels, to the screen, a file or both. use "log.jamo"

var log = new_log("game.log")
log.info("Level 2 started")
log.warn("Low on memory")

Each message gets the time and its level: [14:03:27] WARN Low on memory. A file is added to, never replaced.

constLOG_APPEND

const LOG_APPEND = 4

FILE_APPEND_DATA, shared for reading and writing, OPEN_ALWAYS, so it's made if it isn't there yet

constLOG_SHARE

const LOG_SHARE = 3

constLOG_OPEN_ALWAYS

const LOG_OPEN_ALWAYS = 4

structLog

struct Log
    file: string
    level: int
    to_screen: bool
end

funcnew_log

func new_log(file: string): Log

A log that writes to the screen and, unless file is "", to that file too

funclog_level_number

func log_level_number(name: string): int

funcLog.set_level

func Log.set_level(name: string)

Only messages at this level or above are kept: debug, info (the start), warn or error

funcLog.screen

func Log.screen(on: bool)

funclog_append

func log_append(path: string, text: string): bool

funcLog.write

func Log.write(level: int, words: string)

funcLog.debug

func Log.debug(words: string)

funcLog.info

func Log.info(words: string)

funcLog.warn

func Log.warn(words: string)

funcLog.error

func Log.error(words: string)