22// Copyright (c) PlaceholderCompany. All rights reserved.
33// </copyright>
44
5- namespace Frappe . Net
5+ namespace FrappeRestClient . Net
66{
77 using System ;
88 using System . Collections . Generic ;
9+ using System . Diagnostics ;
910 using System . Threading . Tasks ;
10- using log4net ;
1111 using Newtonsoft . Json ;
1212 using Newtonsoft . Json . Linq ;
1313 using Tiny . RestClient ;
@@ -31,7 +31,6 @@ namespace Frappe.Net
3131 public class Db : JsonObjectParser
3232 {
3333 private const string RESOURCEPATH = "/" ;
34- private static readonly ILog log = LogManager . GetLogger ( typeof ( Db ) ) ;
3534 private FrappeRestClient frappe ;
3635 private TinyRestClient client ;
3736
@@ -113,7 +112,7 @@ public async Task<dynamic> GetListAsync(string doctype, string[] fields = null,
113112 }
114113 catch ( Exception e )
115114 {
116- log . Error ( e . Message ) ;
115+ Debug . WriteLine ( e . Message ) ;
117116 throw ;
118117 }
119118
@@ -245,7 +244,7 @@ public async Task<string> GetValueAsync(string doctype, string fieldName = null,
245244 }
246245 catch ( Exception e )
247246 {
248- log . Error ( e . Message ) ;
247+ Debug . WriteLine ( e . Message ) ;
249248 throw ;
250249 }
251250
@@ -274,7 +273,7 @@ public async Task<string> GetSingleValueAsync(string doctype, string field)
274273 }
275274 catch ( Exception e )
276275 {
277- log . Error ( e . Message ) ;
276+ Debug . WriteLine ( e . Message ) ;
278277 throw ;
279278 }
280279
@@ -389,15 +388,15 @@ public async Task<dynamic> SaveAsync(dynamic doc)
389388 }
390389 catch ( HttpException e )
391390 {
392- log . Error ( $ "{ e . StatusCode } : { e . Message } ") ;
391+ Debug . WriteLine ( $ "{ e . StatusCode } : { e . Message } ") ;
393392 if ( e . StatusCode == System . Net . HttpStatusCode . ExpectationFailed )
394393 {
395394 throw new InvalidOperationException ( "Document not saved" ) ;
396395 }
397396 }
398397 catch ( Exception e )
399398 {
400- log . Error ( e . Message ) ;
399+ Debug . WriteLine ( e . Message ) ;
401400 }
402401
403402 this . frappe . ResetRoute ( ) ;
@@ -428,7 +427,7 @@ public async Task<string> RenameDocAsync(string doctype, string oldName, string
428427 }
429428 catch ( HttpException e )
430429 {
431- log . Error ( $ "{ e . StatusCode } : { e . Message } ") ;
430+ Debug . WriteLine ( $ "{ e . StatusCode } : { e . Message } ") ;
432431 if ( e . StatusCode == System . Net . HttpStatusCode . ExpectationFailed )
433432 {
434433 throw new InvalidOperationException ( "Unable to rename document" ) ;
@@ -577,7 +576,7 @@ public async Task<dynamic> AttachFileAsync(string fileName, byte[] fileData, str
577576 }
578577 catch ( Exception e )
579578 {
580- log . Error ( e . Message ) ;
579+ Debug . WriteLine ( e . Message ) ;
581580 throw ;
582581 }
583582
0 commit comments