Skip to content

Commit 29825cc

Browse files
committed
Merge pull request #8 from brainless83/master
Logging glue code
2 parents bbffbd2 + 6d9bf43 commit 29825cc

8 files changed

Lines changed: 337 additions & 118 deletions

File tree

src/ServiceStack.CacheAccess.Memcached/AdapterBase.cs

Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using ServiceStack.Logging;
3+
4+
namespace ServiceStack.CacheAccess.Memcached
5+
{
6+
public class EnyimLogFactoryWrapper : Enyim.Caching.ILogFactory
7+
{
8+
public Enyim.Caching.ILog GetLogger(string name)
9+
{
10+
return new EnyimLoggerWarpper(LogManager.GetLogger(name));
11+
}
12+
13+
public Enyim.Caching.ILog GetLogger(Type type)
14+
{
15+
return new EnyimLoggerWarpper(LogManager.GetLogger(type));
16+
}
17+
}
18+
}
Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
using System;
2+
using ServiceStack.Logging;
3+
4+
namespace ServiceStack.CacheAccess.Memcached
5+
{
6+
public class EnyimLoggerWarpper : Enyim.Caching.ILog
7+
{
8+
private readonly ILog _serviceStackLogger;
9+
10+
public EnyimLoggerWarpper(ILog serviceStackLogger)
11+
{
12+
_serviceStackLogger = serviceStackLogger;
13+
}
14+
15+
public void Debug(object message)
16+
{
17+
_serviceStackLogger.Debug(message);
18+
}
19+
20+
public void Debug(object message, Exception exception)
21+
{
22+
_serviceStackLogger.Debug(message, exception);
23+
}
24+
25+
public void DebugFormat(string format, object arg0)
26+
{
27+
_serviceStackLogger.DebugFormat(format, arg0);
28+
}
29+
30+
public void DebugFormat(string format, object arg0, object arg1)
31+
{
32+
_serviceStackLogger.DebugFormat(format, arg0, arg1);
33+
}
34+
35+
public void DebugFormat(string format, object arg0, object arg1, object arg2)
36+
{
37+
_serviceStackLogger.DebugFormat(format, arg0, arg1, arg2);
38+
}
39+
40+
public void DebugFormat(string format, params object[] args)
41+
{
42+
_serviceStackLogger.DebugFormat(format, args);
43+
}
44+
45+
public void DebugFormat(IFormatProvider provider, string format, params object[] args)
46+
{
47+
_serviceStackLogger.DebugFormat(format, args);
48+
}
49+
50+
public void Info(object message)
51+
{
52+
_serviceStackLogger.Info(message);
53+
}
54+
55+
public void Info(object message, Exception exception)
56+
{
57+
_serviceStackLogger.Info(message, exception);
58+
}
59+
60+
public void InfoFormat(string format, object arg0)
61+
{
62+
_serviceStackLogger.InfoFormat(format, arg0);
63+
}
64+
65+
public void InfoFormat(string format, object arg0, object arg1)
66+
{
67+
_serviceStackLogger.InfoFormat(format, arg0, arg1);
68+
}
69+
70+
public void InfoFormat(string format, object arg0, object arg1, object arg2)
71+
{
72+
_serviceStackLogger.InfoFormat(format, arg0, arg1, arg2);
73+
}
74+
75+
public void InfoFormat(string format, params object[] args)
76+
{
77+
_serviceStackLogger.InfoFormat(format, args);
78+
}
79+
80+
public void InfoFormat(IFormatProvider provider, string format, params object[] args)
81+
{
82+
_serviceStackLogger.InfoFormat(format, args);
83+
}
84+
85+
public void Warn(object message)
86+
{
87+
_serviceStackLogger.Warn(message);
88+
}
89+
90+
public void Warn(object message, Exception exception)
91+
{
92+
_serviceStackLogger.Warn(message, exception);
93+
}
94+
95+
public void WarnFormat(string format, object arg0)
96+
{
97+
_serviceStackLogger.WarnFormat(format, arg0);
98+
}
99+
100+
public void WarnFormat(string format, object arg0, object arg1)
101+
{
102+
_serviceStackLogger.WarnFormat(format, arg0, arg1);
103+
}
104+
105+
public void WarnFormat(string format, object arg0, object arg1, object arg2)
106+
{
107+
_serviceStackLogger.WarnFormat(format, arg0, arg1, arg2);
108+
}
109+
110+
public void WarnFormat(string format, params object[] args)
111+
{
112+
_serviceStackLogger.WarnFormat(format, args);
113+
}
114+
115+
public void WarnFormat(IFormatProvider provider, string format, params object[] args)
116+
{
117+
_serviceStackLogger.WarnFormat(format, args);
118+
}
119+
120+
public void Error(object message)
121+
{
122+
_serviceStackLogger.Error(message);
123+
}
124+
125+
public void Error(object message, Exception exception)
126+
{
127+
_serviceStackLogger.Error(message, exception);
128+
}
129+
130+
public void ErrorFormat(string format, object arg0)
131+
{
132+
_serviceStackLogger.ErrorFormat(format, arg0);
133+
}
134+
135+
public void ErrorFormat(string format, object arg0, object arg1)
136+
{
137+
_serviceStackLogger.ErrorFormat(format, arg0, arg1);
138+
}
139+
140+
public void ErrorFormat(string format, object arg0, object arg1, object arg2)
141+
{
142+
_serviceStackLogger.ErrorFormat(format, arg0, arg1, arg2);
143+
}
144+
145+
public void ErrorFormat(string format, params object[] args)
146+
{
147+
_serviceStackLogger.ErrorFormat(format, args);
148+
}
149+
150+
public void ErrorFormat(IFormatProvider provider, string format, params object[] args)
151+
{
152+
_serviceStackLogger.ErrorFormat(format, args);
153+
}
154+
155+
public void Fatal(object message)
156+
{
157+
_serviceStackLogger.Fatal(message);
158+
}
159+
160+
public void Fatal(object message, Exception exception)
161+
{
162+
_serviceStackLogger.Fatal(message, exception);
163+
}
164+
165+
public void FatalFormat(string format, object arg0)
166+
{
167+
_serviceStackLogger.FatalFormat(format, arg0);
168+
}
169+
170+
public void FatalFormat(string format, object arg0, object arg1)
171+
{
172+
_serviceStackLogger.FatalFormat(format, arg0, arg1);
173+
}
174+
175+
public void FatalFormat(string format, object arg0, object arg1, object arg2)
176+
{
177+
_serviceStackLogger.FatalFormat(format, arg0, arg1, arg2);
178+
}
179+
180+
public void FatalFormat(string format, params object[] args)
181+
{
182+
_serviceStackLogger.FatalFormat(format, args);
183+
}
184+
185+
public void FatalFormat(IFormatProvider provider, string format, params object[] args)
186+
{
187+
_serviceStackLogger.FatalFormat(format, args);
188+
}
189+
190+
public bool IsDebugEnabled
191+
{
192+
get { return _serviceStackLogger.IsDebugEnabled; }
193+
}
194+
195+
public bool IsInfoEnabled
196+
{
197+
get { return true; }
198+
}
199+
200+
public bool IsWarnEnabled
201+
{
202+
get { return true; }
203+
}
204+
205+
public bool IsErrorEnabled
206+
{
207+
get { return true; }
208+
}
209+
210+
public bool IsFatalEnabled
211+
{
212+
get { return true; }
213+
}
214+
}
215+
}

0 commit comments

Comments
 (0)