Here are all the current logging codes for v0.5 (07/03/08)

Please note that nearly all the code changes only work on the current opened logfile, allowing you to have different settings for different files.

[+] The current line will have no carriage return (or for a html file) written at the end of the line. As a result it will appear joined to the next line, hence the + sign.

[-] The logged line will overwrite the previous line. (Not applicable in console based text)

[|] This will add in a line break, so you don’t have to write multiple log statements.

[x x] (i.e. [x 8]) will repeat the last character 8 times, [x 20] will repeat the last character 20 times.

[1], [2], [3] & [4] or [i], [w], [e], [c] Switches to INFO, WARNING, ERROR and CRITICAL levels for that line respectively. Each level can have it’s own header text and colour.

[5], [6], [7], [8] & [9] Custom logging levels, free for you to use.

Adding:
[default] before the relevant level number or single letter code changes to that level and makes it the default for all subsequent logging information in that logfile.

[filter] before the relevant level number or single letter code changes what logging levels are filtered. For example you can call [filter 1] or [filter i] and only INFO, WARNING, ERROR & CRITICAL levels are logged. Using [filter 3] would only write ERROR or CRITICAL levels. In short, only levels that equal the number and above are logged. For this code you can also use the number 0, or d for the special debugging level, although only the logd function can be used to log actual comments in this.

[bleep] before the relevant level number or single letter code changes how bleeping tones are used. If this command is used then encountering a logging command for that level or above, then a bleep is issued. This can only be done when the console window is open, and does slow down the program execution. However it can be very useful.

Other codes:
[bleep level off] Disable level related bleeping, the default option.

[text] Write a text file for logging, the default option.

[html]Write a html file for logging instead of a text file.

[console]Write to a console window in addition to a text or html file.

[clear]Completely clears a logfile and starts logging at the beginning. Not applicable to console windows, but very useful for debugging inner loops that executes many times per second.

[loop start]Defines the start of a loop.

[loop end]The logging restarts at the same location in the file as the loop start command was encounted. This overwrites old text and is useful in loop situations. Does not apply to the console window.

[loop break]If encountered, tells the logger to ignore any next loop end command until a loop start one is encountered.

[timestamp]Adds a timestamp at the start of each logging line.

[timestamp off]Disables timestamps.

[debugstamp]Adds a debugstamp with the calling source file and line number to the start of each logging line. Only works with debug built logging code (which is slower).

[debugstamp off]Disables debugstamps.

Adds a logging comment warning about any unknown codes, to stop typing errors.

Creates a bleep sound on an unknown logging . Only works if the console window is open.

[file x]Provides a filename for a logfile. If no logfile is open yet, then this is used when the first text to be written is encounted. If a logfile is already open, then a new logfile is opened with this name. And the default logfile is changed to use this one.

[id x]Gives an id tag to the current logfile. From then on, this name can be used to switch between files, i.e. [file game inner loop][id gloop]would let you use [gloop] to write to that file. The change is made permanently until the next file id code is found. This code is only useful for multiple logfiles and needs to be encountered after a [file] code if you are opening more than one logfile.

[level label x]Changes the text used for a particular level logging label.

[level color x]Changes the colour used in the html logging for a particular level, x needs to be in the hexadecimal format of #xxxxxx

0 Responses to “[codes]”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s





%d bloggers like this: