Click here to Skip to main content
15,891,657 members
Home / Discussions / C#
   

C#

 
SuggestionRe: C# Pin
Richard MacCutchan19-Aug-15 20:55
mveRichard MacCutchan19-Aug-15 20:55 
AnswerRe: C# Pin
OriginalGriff19-Aug-15 21:38
mveOriginalGriff19-Aug-15 21:38 
AnswerRe: C# Pin
Abhipal Singh20-Aug-15 7:44
professionalAbhipal Singh20-Aug-15 7:44 
GeneralRe: C# Pin
clientSurfer26-Aug-15 9:32
professionalclientSurfer26-Aug-15 9:32 
QuestionAbout LightSwitch application Pin
Super Lloyd19-Aug-15 18:31
Super Lloyd19-Aug-15 18:31 
QuestionImplementing a LogHelper class - is this approach right Pin
Bartosz Jarmuż19-Aug-15 6:00
Bartosz Jarmuż19-Aug-15 6:00 
AnswerRe: Implementing a LogHelper class - is this approach right Pin
Eddy Vluggen19-Aug-15 7:16
professionalEddy Vluggen19-Aug-15 7:16 
GeneralRe: Implementing a LogHelper class - is this approach right Pin
Bartosz Jarmuż19-Aug-15 7:53
Bartosz Jarmuż19-Aug-15 7:53 
Thanks for you reply!

So... if I create an ILogger interface, then... In my applications I would use it as follows:
C#
ILogger TxtLog {get;set;}
ILogger DebugLog {get;set;}
ILogger CsvLog {get;set;}

TxtLog = LogFactory.CreateLogger("txt");
DebugLog = LogFactory.CreateLogger("debug");
CsvLog = LogFactory.CreateLogger("csv");

But that would require my separate log types to have the same methods - and I guess I want to have different methods for different types of logs - e.g. csv log will be used to produce sort of reports for the users, debug log will be customized to log errors with severity etc, whereas txt logs will be for users to analyze what the program was doing.

So don't I rather want to specify the log types explicitly?

Also, this leads to 'why use factory and not just three separate classes?' Does the factory pattern forces it to be safer in any way?
GeneralRe: Implementing a LogHelper class - is this approach right Pin
Pete O'Hanlon19-Aug-15 8:02
mvePete O'Hanlon19-Aug-15 8:02 
GeneralRe: Implementing a LogHelper class - is this approach right Pin
Bartosz Jarmuż19-Aug-15 8:55
Bartosz Jarmuż19-Aug-15 8:55 
GeneralRe: Implementing a LogHelper class - is this approach right Pin
Eddy Vluggen19-Aug-15 8:44
professionalEddy Vluggen19-Aug-15 8:44 
GeneralRe: Implementing a LogHelper class - is this approach right Pin
Bartosz Jarmuż19-Aug-15 9:15
Bartosz Jarmuż19-Aug-15 9:15 
GeneralRe: Implementing a LogHelper class - is this approach right Pin
Eddy Vluggen19-Aug-15 11:25
professionalEddy Vluggen19-Aug-15 11:25 
AnswerRe: Implementing a LogHelper class - is this approach right Pin
V.19-Aug-15 10:43
professionalV.19-Aug-15 10:43 
GeneralWhat's more efficient in .Any and .Count in C# (Extension methods) Pin
rosharavinda19-Aug-15 5:01
rosharavinda19-Aug-15 5:01 
GeneralRe: What's more efficient in .Any and .Count in C# (Extension methods) Pin
Pete O'Hanlon19-Aug-15 5:25
mvePete O'Hanlon19-Aug-15 5:25 
GeneralRe: What's more efficient in .Any and .Count in C# (Extension methods) Pin
OriginalGriff19-Aug-15 5:32
mveOriginalGriff19-Aug-15 5:32 
GeneralRe: What's more efficient in .Any and .Count in C# (Extension methods) Pin
Nitzan Levi19-Aug-15 9:47
Nitzan Levi19-Aug-15 9:47 
QuestionPerformance of FileStream, scale is stalking me Pin
Rob Philpott19-Aug-15 3:36
Rob Philpott19-Aug-15 3:36 
AnswerRe: Performance of FileStream, scale is stalking me Pin
Eddy Vluggen19-Aug-15 4:49
professionalEddy Vluggen19-Aug-15 4:49 
GeneralRe: Performance of FileStream, scale is stalking me Pin
Rob Philpott19-Aug-15 4:52
Rob Philpott19-Aug-15 4:52 
GeneralRe: Performance of FileStream, scale is stalking me Pin
Eddy Vluggen19-Aug-15 4:54
professionalEddy Vluggen19-Aug-15 4:54 
GeneralRe: Performance of FileStream, scale is stalking me Pin
Rob Philpott19-Aug-15 5:09
Rob Philpott19-Aug-15 5:09 
GeneralRe: Performance of FileStream, scale is stalking me Pin
Eddy Vluggen19-Aug-15 7:09
professionalEddy Vluggen19-Aug-15 7:09 
GeneralRe: Performance of FileStream, scale is stalking me Pin
Rob Philpott19-Aug-15 7:18
Rob Philpott19-Aug-15 7:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.