Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Logging Multiple_level_logger_for_debug  

Multiple_level_logger_for_debug

Test Script

Category: Logging
By : kagefumi
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Multiple_level_logger_for_debug
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Multiple_level_logger_for_debug_1.lsl
Get file # 2. Multiple_level_logger_for_debug_2.lsl
1 default
2 {
4 {
5 integer i;
6 for (i = 0; i <= 4; i++)
7 {
8 log_level = i;
9 logSayDebug("log_level" + (string) log_level + ". This is debug.");
10 logSayInfo("log_level" + (string) log_level + ". This is info.");
11 logSayWarn("log_level" + (string) log_level + ". This is warn.");
12 logSayError("log_level" + (string) log_level + ". This is error.");
13 logSayFatal("log_level" + (string) log_level + ". This is fatal.");
14 }
15 }
16 }

Multiple_level_logger_for_debug

Log Script

Category: Logging
By : kagefumi
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

1 //===============================================
2 //
3 // Logger
4 //
5 //===============================================
6
7 // Set log level.
8 // 0:DEBUG, 1:INFO, 2:WARN, 3:ERROR, 4:FATAL
9 integer log_level = 0;
10
11 //
12 // Says debug log.
13 //
14 logSayDebug(string message)
15 {
16 logSay(0, "DEBUG: " + message);
17 }
18 //
19 // Says info log.
20 //
21 logSayInfo(string message)
22 {
23 logSay(1, " INFO: " + message);
24 }
25 //
26 // Says warn log.
27 //
28 logSayWarn(string message)
29 {
30 logSay(2, " WARN: " + message);
31 }
32 //
33 // Says error log.
34 //
35 logSayError(string message)
36 {
37 logSay(3, "ERROR: " + message);
38 }
39 //
40 // Says fatal log.
41 //
42 logSayFatal(string message)
43 {
44 logSay(4, "FATAL: " + message);
45 }
46 logSay(integer level, string message)
47 {
48 if(log_level <= level)
49 {
50 llSay(0, message);
51 }
52 }

Back to the Best Free Tools in Second Life and OpenSim.