Skip to content
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

Merged
merged 11 commits into from
Sep 18, 2017
Merged

Introduced the following new elements. #247

merged 11 commits into from
Sep 18, 2017

Conversation

DHirani
Copy link
Contributor

@DHirani DHirani commented Aug 29, 2017

  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.

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.
Copy link
Member

@oleg-nenashev oleg-nenashev left a 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

@@ -33,7 +33,7 @@
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(SolutionDir)..\winsw_key.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>winsw_key.snk</AssemblyOriginatorKeyFile>
Copy link
Member

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

Copy link
Contributor Author

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"; } }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy-paste error ?

Copy link
Contributor Author

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"/>
Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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 @@
<!--
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

@@ -73,6 +73,7 @@
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="winsw_key.snk" />
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

@oleg-nenashev oleg-nenashev left a 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

@DHirani
Copy link
Contributor Author

DHirani commented Aug 29, 2017

Removed the snk file and sqllite file

DHirani and others added 6 commits August 31, 2017 13:35
…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.
@oleg-nenashev oleg-nenashev self-assigned this Aug 31, 2017
Copy link
Member

@oleg-nenashev oleg-nenashev left a 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;
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Member

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
Copy link
Member

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.

@oleg-nenashev
Copy link
Member

Tested it a bit yesterday, looks good to me.
I will write some documentation for that before the release

@oleg-nenashev oleg-nenashev merged commit 221d30f into winsw:master Sep 18, 2017
@DHirani
Copy link
Contributor Author

DHirani commented Sep 19, 2017

Thanks for pushing the change into master, when will the package be available from nuget?

@oleg-nenashev
Copy link
Member

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants