aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.MSSQL
diff options
context:
space:
mode:
authorJeff Ames2008-02-05 19:44:27 +0000
committerJeff Ames2008-02-05 19:44:27 +0000
commit6ed5283bc06a62f38eb517e67b975832b603bf61 (patch)
treee5f635018789b73a99ddeca0883a68368fa5eece /OpenSim/Framework/Data.MSSQL
parentCut down on the number of packets sent during terraforming. Terraforming shou... (diff)
downloadopensim-SC-6ed5283bc06a62f38eb517e67b975832b603bf61.zip
opensim-SC-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.gz
opensim-SC-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.bz2
opensim-SC-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.xz
Converted logging to use log4net.
Changed LogBase to ConsoleBase, which handles console I/O. This is mostly an in-place conversion, so lots of refactoring can still be done.
Diffstat (limited to 'OpenSim/Framework/Data.MSSQL')
-rw-r--r--OpenSim/Framework/Data.MSSQL/MSSQLAssetData.cs6
-rw-r--r--OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs6
-rw-r--r--OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs34
-rw-r--r--OpenSim/Framework/Data.MSSQL/MSSQLManager.cs16
-rw-r--r--OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs26
5 files changed, 49 insertions, 39 deletions
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLAssetData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLAssetData.cs
index 08fbef0..4d5e4c7 100644
--- a/OpenSim/Framework/Data.MSSQL/MSSQLAssetData.cs
+++ b/OpenSim/Framework/Data.MSSQL/MSSQLAssetData.cs
@@ -37,6 +37,8 @@ namespace OpenSim.Framework.Data.MSSQL
37{ 37{
38 internal class MSSQLAssetData : IAssetProvider 38 internal class MSSQLAssetData : IAssetProvider
39 { 39 {
40 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
41
40 private MSSQLManager database; 42 private MSSQLManager database;
41 43
42 #region IAssetProvider Members 44 #region IAssetProvider Members
@@ -46,7 +48,7 @@ namespace OpenSim.Framework.Data.MSSQL
46 // null as the version, indicates that the table didn't exist 48 // null as the version, indicates that the table didn't exist
47 if (tableName == null) 49 if (tableName == null)
48 { 50 {
49 MainLog.Instance.Notice("ASSETS", "Creating new database tables"); 51 m_log.Info("[ASSETS]: Creating new database tables");
50 database.ExecuteResourceSql("CreateAssetsTable.sql"); 52 database.ExecuteResourceSql("CreateAssetsTable.sql");
51 return; 53 return;
52 } 54 }
@@ -164,7 +166,7 @@ namespace OpenSim.Framework.Data.MSSQL
164 } 166 }
165 catch (Exception e) 167 catch (Exception e)
166 { 168 {
167 MainLog.Instance.Error(e.ToString()); 169 m_log.Error(e.ToString());
168 } 170 }
169 } 171 }
170 172
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs
index 7d228e6..28eec3e 100644
--- a/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs
+++ b/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs
@@ -40,6 +40,8 @@ namespace OpenSim.Framework.Data.MSSQL
40 /// </summary> 40 /// </summary>
41 public class SqlGridData : IGridData 41 public class SqlGridData : IGridData
42 { 42 {
43 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
44
43 /// <summary> 45 /// <summary>
44 /// Database manager 46 /// Database manager
45 /// </summary> 47 /// </summary>
@@ -172,7 +174,7 @@ namespace OpenSim.Framework.Data.MSSQL
172 catch (Exception e) 174 catch (Exception e)
173 { 175 {
174 database.Reconnect(); 176 database.Reconnect();
175 MainLog.Instance.Error(e.ToString()); 177 m_log.Error(e.ToString());
176 return returnlist; 178 return returnlist;
177 } 179 }
178 } 180 }
@@ -208,7 +210,7 @@ namespace OpenSim.Framework.Data.MSSQL
208 catch (Exception e) 210 catch (Exception e)
209 { 211 {
210 database.Reconnect(); 212 database.Reconnect();
211 MainLog.Instance.Error(e.ToString()); 213 m_log.Error(e.ToString());
212 return returnlist; 214 return returnlist;
213 } 215 }
214 } 216 }
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs
index 2e5d679..d79d369 100644
--- a/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs
+++ b/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs
@@ -39,6 +39,8 @@ namespace OpenSim.Framework.Data.MSSQL
39 /// </summary> 39 /// </summary>
40 public class MSSQLInventoryData : IInventoryData 40 public class MSSQLInventoryData : IInventoryData
41 { 41 {
42 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
43
42 /// <summary> 44 /// <summary>
43 /// The database manager 45 /// The database manager
44 /// </summary> 46 /// </summary>
@@ -159,7 +161,7 @@ namespace OpenSim.Framework.Data.MSSQL
159 catch (Exception e) 161 catch (Exception e)
160 { 162 {
161 database.Reconnect(); 163 database.Reconnect();
162 MainLog.Instance.Error(e.ToString()); 164 m_log.Error(e.ToString());
163 return null; 165 return null;
164 } 166 }
165 } 167 }
@@ -198,7 +200,7 @@ namespace OpenSim.Framework.Data.MSSQL
198 catch (Exception e) 200 catch (Exception e)
199 { 201 {
200 database.Reconnect(); 202 database.Reconnect();
201 MainLog.Instance.Error(e.ToString()); 203 m_log.Error(e.ToString());
202 return null; 204 return null;
203 } 205 }
204 } 206 }
@@ -244,7 +246,7 @@ namespace OpenSim.Framework.Data.MSSQL
244 catch (Exception e) 246 catch (Exception e)
245 { 247 {
246 database.Reconnect(); 248 database.Reconnect();
247 MainLog.Instance.Error(e.ToString()); 249 m_log.Error(e.ToString());
248 return null; 250 return null;
249 } 251 }
250 } 252 }
@@ -282,7 +284,7 @@ namespace OpenSim.Framework.Data.MSSQL
282 catch (Exception e) 284 catch (Exception e)
283 { 285 {
284 database.Reconnect(); 286 database.Reconnect();
285 MainLog.Instance.Error(e.ToString()); 287 m_log.Error(e.ToString());
286 return null; 288 return null;
287 } 289 }
288 } 290 }
@@ -315,7 +317,7 @@ namespace OpenSim.Framework.Data.MSSQL
315 } 317 }
316 catch (SqlException e) 318 catch (SqlException e)
317 { 319 {
318 MainLog.Instance.Error(e.ToString()); 320 m_log.Error(e.ToString());
319 } 321 }
320 322
321 return null; 323 return null;
@@ -352,7 +354,7 @@ namespace OpenSim.Framework.Data.MSSQL
352 catch (Exception e) 354 catch (Exception e)
353 { 355 {
354 database.Reconnect(); 356 database.Reconnect();
355 MainLog.Instance.Error(e.ToString()); 357 m_log.Error(e.ToString());
356 } 358 }
357 return null; 359 return null;
358 } 360 }
@@ -377,7 +379,7 @@ namespace OpenSim.Framework.Data.MSSQL
377 } 379 }
378 catch (Exception e) 380 catch (Exception e)
379 { 381 {
380 MainLog.Instance.Error(e.ToString()); 382 m_log.Error(e.ToString());
381 } 383 }
382 384
383 return null; 385 return null;
@@ -412,7 +414,7 @@ namespace OpenSim.Framework.Data.MSSQL
412 catch (Exception e) 414 catch (Exception e)
413 { 415 {
414 database.Reconnect(); 416 database.Reconnect();
415 MainLog.Instance.Error(e.ToString()); 417 m_log.Error(e.ToString());
416 return null; 418 return null;
417 } 419 }
418 } 420 }
@@ -452,7 +454,7 @@ namespace OpenSim.Framework.Data.MSSQL
452 } 454 }
453 catch (SqlException e) 455 catch (SqlException e)
454 { 456 {
455 MainLog.Instance.Error(e.ToString()); 457 m_log.Error(e.ToString());
456 } 458 }
457 } 459 }
458 460
@@ -511,7 +513,7 @@ namespace OpenSim.Framework.Data.MSSQL
511 } 513 }
512 catch (Exception e) 514 catch (Exception e)
513 { 515 {
514 MainLog.Instance.Error(e.ToString()); 516 m_log.Error(e.ToString());
515 } 517 }
516 } 518 }
517 519
@@ -533,7 +535,7 @@ namespace OpenSim.Framework.Data.MSSQL
533 catch (SqlException e) 535 catch (SqlException e)
534 { 536 {
535 database.Reconnect(); 537 database.Reconnect();
536 MainLog.Instance.Error(e.ToString()); 538 m_log.Error(e.ToString());
537 } 539 }
538 } 540 }
539 541
@@ -564,7 +566,7 @@ namespace OpenSim.Framework.Data.MSSQL
564 } 566 }
565 catch (Exception e) 567 catch (Exception e)
566 { 568 {
567 MainLog.Instance.Error(e.ToString()); 569 m_log.Error(e.ToString());
568 } 570 }
569 } 571 }
570 572
@@ -602,7 +604,7 @@ namespace OpenSim.Framework.Data.MSSQL
602 } 604 }
603 catch (Exception e) 605 catch (Exception e)
604 { 606 {
605 MainLog.Instance.Error(e.ToString()); 607 m_log.Error(e.ToString());
606 } 608 }
607 } 609 }
608 610
@@ -628,7 +630,7 @@ namespace OpenSim.Framework.Data.MSSQL
628 } 630 }
629 catch (Exception e) 631 catch (Exception e)
630 { 632 {
631 MainLog.Instance.Error(e.ToString()); 633 m_log.Error(e.ToString());
632 } 634 }
633 } 635 }
634 636
@@ -675,7 +677,7 @@ namespace OpenSim.Framework.Data.MSSQL
675 catch (SqlException e) 677 catch (SqlException e)
676 { 678 {
677 database.Reconnect(); 679 database.Reconnect();
678 MainLog.Instance.Error(e.ToString()); 680 m_log.Error(e.ToString());
679 } 681 }
680 } 682 }
681 683
@@ -695,7 +697,7 @@ namespace OpenSim.Framework.Data.MSSQL
695 catch (SqlException e) 697 catch (SqlException e)
696 { 698 {
697 database.Reconnect(); 699 database.Reconnect();
698 MainLog.Instance.Error(e.ToString()); 700 m_log.Error(e.ToString());
699 } 701 }
700 } 702 }
701 703
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs b/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs
index 3a70909..e54cde1 100644
--- a/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs
+++ b/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs
@@ -42,6 +42,8 @@ namespace OpenSim.Framework.Data.MSSQL
42 /// </summary> 42 /// </summary>
43 internal class MSSQLManager 43 internal class MSSQLManager
44 { 44 {
45 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
46
45 /// <summary> 47 /// <summary>
46 /// The database connection object 48 /// The database connection object
47 /// </summary> 49 /// </summary>
@@ -92,7 +94,7 @@ namespace OpenSim.Framework.Data.MSSQL
92 } 94 }
93 catch (Exception) 95 catch (Exception)
94 { 96 {
95 MainLog.Instance.Verbose("DATASTORE", "MSSQL Database doesn't exist... creating"); 97 m_log.Info("[DATASTORE]: MSSQL Database doesn't exist... creating");
96 InitDB(conn); 98 InitDB(conn);
97 } 99 }
98 cmd = Query("select top 1 webLoginKey from users", new Dictionary<string, string>()); 100 cmd = Query("select top 1 webLoginKey from users", new Dictionary<string, string>());
@@ -260,7 +262,7 @@ namespace OpenSim.Framework.Data.MSSQL
260 } 262 }
261 catch (Exception e) 263 catch (Exception e)
262 { 264 {
263 MainLog.Instance.Error("Unable to reconnect to database " + e.ToString()); 265 m_log.Error("Unable to reconnect to database " + e.ToString());
264 } 266 }
265 } 267 }
266 } 268 }
@@ -529,7 +531,7 @@ namespace OpenSim.Framework.Data.MSSQL
529 } 531 }
530 catch (Exception e) 532 catch (Exception e)
531 { 533 {
532 MainLog.Instance.Error("MSSQLManager : " + e.ToString()); 534 m_log.Error("MSSQLManager : " + e.ToString());
533 } 535 }
534 536
535 return returnval; 537 return returnval;
@@ -573,7 +575,7 @@ namespace OpenSim.Framework.Data.MSSQL
573 } 575 }
574 catch (Exception e) 576 catch (Exception e)
575 { 577 {
576 MainLog.Instance.Error(e.ToString()); 578 m_log.Error(e.ToString());
577 return false; 579 return false;
578 } 580 }
579 581
@@ -667,7 +669,7 @@ namespace OpenSim.Framework.Data.MSSQL
667 } 669 }
668 catch (Exception e) 670 catch (Exception e)
669 { 671 {
670 MainLog.Instance.Error(e.ToString()); 672 m_log.Error(e.ToString());
671 return false; 673 return false;
672 } 674 }
673 675
@@ -688,7 +690,7 @@ namespace OpenSim.Framework.Data.MSSQL
688 } 690 }
689 catch (Exception e) 691 catch (Exception e)
690 { 692 {
691 MainLog.Instance.Error("Unable to execute query " + e.ToString()); 693 m_log.Error("Unable to execute query " + e.ToString());
692 } 694 }
693 } 695 }
694 696
@@ -721,7 +723,7 @@ namespace OpenSim.Framework.Data.MSSQL
721 } 723 }
722 catch (Exception e) 724 catch (Exception e)
723 { 725 {
724 MainLog.Instance.Error(e.ToString()); 726 m_log.Error(e.ToString());
725 } 727 }
726 } 728 }
727 tables.Close(); 729 tables.Close();
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs
index aa0526c..ed9929c 100644
--- a/OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs
+++ b/OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs
@@ -39,6 +39,8 @@ namespace OpenSim.Framework.Data.MSSQL
39 /// </summary> 39 /// </summary>
40 internal class MSSQLUserData : IUserData 40 internal class MSSQLUserData : IUserData
41 { 41 {
42 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
43
42 /// <summary> 44 /// <summary>
43 /// Database manager for MySQL 45 /// Database manager for MySQL
44 /// </summary> 46 /// </summary>
@@ -94,7 +96,7 @@ namespace OpenSim.Framework.Data.MSSQL
94 catch (Exception e) 96 catch (Exception e)
95 { 97 {
96 database.Reconnect(); 98 database.Reconnect();
97 MainLog.Instance.Error(e.ToString()); 99 m_log.Error(e.ToString());
98 return null; 100 return null;
99 } 101 }
100 } 102 }
@@ -103,22 +105,22 @@ namespace OpenSim.Framework.Data.MSSQL
103 105
104 public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) 106 public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms)
105 { 107 {
106 MainLog.Instance.Verbose("FRIEND", "Stub AddNewUserFriend called"); 108 m_log.Info("[FRIEND]: Stub AddNewUserFriend called");
107 } 109 }
108 110
109 public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) 111 public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend)
110 { 112 {
111 MainLog.Instance.Verbose("FRIEND", "Stub RemoveUserFriend called"); 113 m_log.Info("[FRIEND]: Stub RemoveUserFriend called");
112 } 114 }
113 public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) 115 public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms)
114 { 116 {
115 MainLog.Instance.Verbose("FRIEND", "Stub UpdateUserFriendPerms called"); 117 m_log.Info("[FRIEND]: Stub UpdateUserFriendPerms called");
116 } 118 }
117 119
118 120
119 public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner) 121 public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner)
120 { 122 {
121 MainLog.Instance.Verbose("FRIEND", "Stub GetUserFriendList called"); 123 m_log.Info("[FRIEND]: Stub GetUserFriendList called");
122 return new List<FriendListItem>(); 124 return new List<FriendListItem>();
123 } 125 }
124 126
@@ -126,7 +128,7 @@ namespace OpenSim.Framework.Data.MSSQL
126 128
127 public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid) 129 public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid)
128 { 130 {
129 MainLog.Instance.Verbose("USER", "Stub UpdateUserCUrrentRegion called"); 131 m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called");
130 } 132 }
131 133
132 134
@@ -168,7 +170,7 @@ namespace OpenSim.Framework.Data.MSSQL
168 catch (Exception e) 170 catch (Exception e)
169 { 171 {
170 database.Reconnect(); 172 database.Reconnect();
171 MainLog.Instance.Error(e.ToString()); 173 m_log.Error(e.ToString());
172 return returnlist; 174 return returnlist;
173 } 175 }
174 } 176 }
@@ -204,7 +206,7 @@ namespace OpenSim.Framework.Data.MSSQL
204 catch (Exception e) 206 catch (Exception e)
205 { 207 {
206 database.Reconnect(); 208 database.Reconnect();
207 MainLog.Instance.Error(e.ToString()); 209 m_log.Error(e.ToString());
208 return returnlist; 210 return returnlist;
209 } 211 }
210 } 212 }
@@ -235,7 +237,7 @@ namespace OpenSim.Framework.Data.MSSQL
235 catch (Exception e) 237 catch (Exception e)
236 { 238 {
237 database.Reconnect(); 239 database.Reconnect();
238 MainLog.Instance.Error(e.ToString()); 240 m_log.Error(e.ToString());
239 return null; 241 return null;
240 } 242 }
241 } 243 }
@@ -290,7 +292,7 @@ namespace OpenSim.Framework.Data.MSSQL
290 catch (Exception e) 292 catch (Exception e)
291 { 293 {
292 database.Reconnect(); 294 database.Reconnect();
293 MainLog.Instance.Error(e.ToString()); 295 m_log.Error(e.ToString());
294 return null; 296 return null;
295 } 297 }
296 } 298 }
@@ -324,7 +326,7 @@ namespace OpenSim.Framework.Data.MSSQL
324 catch (Exception e) 326 catch (Exception e)
325 { 327 {
326 database.Reconnect(); 328 database.Reconnect();
327 MainLog.Instance.Error(e.ToString()); 329 m_log.Error(e.ToString());
328 } 330 }
329 } 331 }
330 332
@@ -426,7 +428,7 @@ namespace OpenSim.Framework.Data.MSSQL
426 } 428 }
427 catch (Exception e) 429 catch (Exception e)
428 { 430 {
429 MainLog.Instance.Error(e.ToString()); 431 m_log.Error(e.ToString());
430 } 432 }
431 return false; 433 return false;
432 } 434 }