-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduced the following new elements. #247
Conversation
DHirani
commented
Aug 29, 2017
- logname - you can override the name of the log file rather than using the EXE name, this means you don't have to call your EXE a different name, just name the winsw exe different. Default's the name to the EXE as before.
- outfiledisabled - you can disable writing to the out file. Defaults to false.
- errfiledisabled - you can disable writing to the error file. Defaults to false.
- outfilepattern - you can choose the pattern of the out file. Defaults to .out.log.
- errfilepattern - you can choos the pattern of the error file. Defaults to .err.log.
1. logname - you can override the name of the log file rather than using the EXE name, this means you don't have to call your EXE a different name, just name the winsw exe different. Default's the name to the EXE as before. 2. outfiledisabled - you can disable writing to the out file. Defaults to false. 3. errfiledisabled - you can disable writing to the error file. Defaults to false. 4. outfilepattern - you can choose the pattern of the out file. Defaults to .out.log. 5. errfilepattern - you can choos the pattern of the error file. Defaults to .err.log.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was planning to do such things as sample configurations in #213, but it makes sense to have separate controls since somebody is ready to spend time on this. Thanks!
The PR needs some polishing, fix of the Default error log, and some unit tests. The default options roundtrip is automatic, but it does not catch things like wrong defaults and XML patterns
src/Core/WinSWCore/WinSWCore.csproj
Outdated
@@ -33,7 +33,7 @@ | |||
</PropertyGroup> | |||
<PropertyGroup> | |||
<SignAssembly>true</SignAssembly> | |||
<AssemblyOriginatorKeyFile>$(SolutionDir)..\winsw_key.snk</AssemblyOriginatorKeyFile> | |||
<AssemblyOriginatorKeyFile>winsw_key.snk</AssemblyOriginatorKeyFile> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not work correctly on the solution level, at least in my IDE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
public bool OutFileDisabled { get { return false; } } | ||
public bool ErrFileDisabled { get { return false; } } | ||
public string OutFilePattern { get { return ".out.log"; } } | ||
public string ErrFilePattern { get { return ".out.log"; } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy-paste error ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -0,0 +1,10 @@ | |||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> | |||
<assemblyIdentity version="1.0.0.0" name="winsw" type="win32"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version needs to be patched in the build flow if you want to include it to the release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the file should not been created.
@@ -355,6 +362,49 @@ public string LogMode | |||
} | |||
} | |||
|
|||
public string LogName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imho all the options should be defined in the <logging>
tag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've followed the same logic as logmode, logpath, let me know if its wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack, will need to think about it twice.
@@ -0,0 +1,308 @@ | |||
<!-- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would you need this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
src/Core/WinSWCore/WinSWCore.csproj
Outdated
@@ -73,6 +73,7 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<None Include="packages.config" /> | |||
<None Include="winsw_key.snk" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SNK must not be included into the repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are still src/.vs/winsw/v15/sqlite3/storage.ide and *.snk files added
Removed the snk file and sqllite file |
…led and errfilepattern. Created a new appender called roll-by-size-time see class RollingSizeTimeLogAppender, this appender supports rolling by time and size and rolling at a specific time each day. Added unit test for the new appender. Added a new option testwait which is similar to test but waits for the user to press any key before calling the stop method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change mostly looks good to me. Ideally it should have been submitted as separate pull requests, but I can live with the current state as well.
I will need to do some manual testing before the merging. Due to the conference period, it may take a while (1-2 weeks) before I actually release the change. Is it fine for you?
if (nextFileNumber == 0) throw new IOException("Cannot roll the file because matching pattern not found"); | ||
nextFileNumber++; | ||
} | ||
return nextFileNumber; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some copy-paste in this appender, but OK for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is fine I will use my fork version until you merge it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi let me know when you planning to merge this into master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My optimistic plan - this Saturday
@@ -355,6 +362,49 @@ public string LogMode | |||
} | |||
} | |||
|
|||
public string LogName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack, will need to think about it twice.
Tested it a bit yesterday, looks good to me. |
Thanks for pushing the change into master, when will the package be available from nuget? |
@DHirani it will be officially released once I update documentation to reflect the new features (README, logging page, config samples). It may take a while, but I will be happy to review the PRs if you have some time to work on them. Anyway, the code looks good, so the documentation should not take much time |