diff options
Diffstat (limited to '')
-rw-r--r-- | OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLLogData.cs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLLogData.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLLogData.cs index c2f9653..3765ae1 100644 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLLogData.cs +++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLLogData.cs | |||
@@ -1,13 +1,48 @@ | |||
1 | /* | ||
2 | * Copyright (c) OpenSim project, http://sim.opensecondlife.org/ | ||
3 | * | ||
4 | * Redistribution and use in source and binary forms, with or without | ||
5 | * modification, are permitted provided that the following conditions are met: | ||
6 | * * Redistributions of source code must retain the above copyright | ||
7 | * notice, this list of conditions and the following disclaimer. | ||
8 | * * Redistributions in binary form must reproduce the above copyright | ||
9 | * notice, this list of conditions and the following disclaimer in the | ||
10 | * documentation and/or other materials provided with the distribution. | ||
11 | * * Neither the name of the <organization> nor the | ||
12 | * names of its contributors may be used to endorse or promote products | ||
13 | * derived from this software without specific prior written permission. | ||
14 | * | ||
15 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
16 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
18 | * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY | ||
19 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
22 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
25 | * | ||
26 | */ | ||
1 | using System; | 27 | using System; |
2 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
3 | using System.Text; | 29 | using System.Text; |
4 | 30 | ||
5 | namespace OpenGrid.Framework.Data.MySQL | 31 | namespace OpenGrid.Framework.Data.MySQL |
6 | { | 32 | { |
33 | /// <summary> | ||
34 | /// An interface to the log database for MySQL | ||
35 | /// </summary> | ||
7 | class MySQLLogData : ILogData | 36 | class MySQLLogData : ILogData |
8 | { | 37 | { |
38 | /// <summary> | ||
39 | /// The database manager | ||
40 | /// </summary> | ||
9 | public MySQLManager database; | 41 | public MySQLManager database; |
10 | 42 | ||
43 | /// <summary> | ||
44 | /// Artificial constructor called when the plugin is loaded | ||
45 | /// </summary> | ||
11 | public void Initialise() | 46 | public void Initialise() |
12 | { | 47 | { |
13 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); | 48 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); |
@@ -21,6 +56,15 @@ namespace OpenGrid.Framework.Data.MySQL | |||
21 | database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); | 56 | database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); |
22 | } | 57 | } |
23 | 58 | ||
59 | /// <summary> | ||
60 | /// Saves a log item to the database | ||
61 | /// </summary> | ||
62 | /// <param name="serverDaemon">The daemon triggering the event</param> | ||
63 | /// <param name="target">The target of the action (region / agent UUID, etc)</param> | ||
64 | /// <param name="methodCall">The method call where the problem occured</param> | ||
65 | /// <param name="arguments">The arguments passed to the method</param> | ||
66 | /// <param name="priority">How critical is this?</param> | ||
67 | /// <param name="logMessage">The message to log</param> | ||
24 | public void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority, string logMessage) | 68 | public void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority, string logMessage) |
25 | { | 69 | { |
26 | try | 70 | try |
@@ -33,16 +77,27 @@ namespace OpenGrid.Framework.Data.MySQL | |||
33 | } | 77 | } |
34 | } | 78 | } |
35 | 79 | ||
80 | /// <summary> | ||
81 | /// Returns the name of this DB provider | ||
82 | /// </summary> | ||
83 | /// <returns>A string containing the DB provider name</returns> | ||
36 | public string getName() | 84 | public string getName() |
37 | { | 85 | { |
38 | return "MySQL Logdata Interface"; | 86 | return "MySQL Logdata Interface"; |
39 | } | 87 | } |
40 | 88 | ||
89 | /// <summary> | ||
90 | /// Closes the database provider | ||
91 | /// </summary> | ||
41 | public void Close() | 92 | public void Close() |
42 | { | 93 | { |
43 | // Do nothing. | 94 | // Do nothing. |
44 | } | 95 | } |
45 | 96 | ||
97 | /// <summary> | ||
98 | /// Returns the version of this DB provider | ||
99 | /// </summary> | ||
100 | /// <returns>A string containing the provider version</returns> | ||
46 | public string getVersion() | 101 | public string getVersion() |
47 | { | 102 | { |
48 | return "0.1"; | 103 | return "0.1"; |