Skip to content

Conversation

@oblaise
Copy link
Contributor

@oblaise oblaise commented Jan 25, 2022

Description

This PR add support for a Logging provider that sends logs using Syslog protocol

Motivation and Context

Syslog is a common logging provider with server present on most Un*x distributions. Servers also exist for Windows.

How Has This Been Tested?

Used in a project. Logs are sent to a Syslog server present in an opensource project: https://github.com/PJO2/tftpd64/
It is hard to create unit test as you need a server on the other side.

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Unit Tests (work on Unit Tests, has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@nfbot nfbot added Type: enhancement New feature or request Type: Documentation Improvements or additions to documentation labels Jan 25, 2022
Copy link
Member

@Ellerbach Ellerbach left a comment

Choose a reason for hiding this comment

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

Nice all up! Some adjustments needed in the code, missing headers as well, all up, real good!

Copy link
Member

@Ellerbach Ellerbach left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks again. If you can adjust the few 'picky' things, it would be perfect.

@Ellerbach
Copy link
Member

@josesimoes the check for the versions does not understand the $version$, I guess those cases with $something$ should be excluded or just displayed as warning.

@oblaise
Copy link
Contributor Author

oblaise commented Jan 26, 2022

Looks good to me. Thanks again. If you can adjust the few 'picky' things, it would be perfect.

Done ;-)

@josesimoes
Copy link
Member

@josesimoes the check for the versions does not understand the $version$, I guess those cases with $something$ should be excluded or just displayed as warning.

@Ellerbach it does. The thing is that, despite being a valid nuspec value, the nuspec parser doesn't deal properly with these situations. A matter of adding this new assembly to the edge case list on nanovc.

@Ellerbach
Copy link
Member

A matter of adding this new assembly to the edge case list on nanovc.

Done :-) In PR :-) Will be a good test to see if all is in order now ;-)

@oblaise
Copy link
Contributor Author

oblaise commented Jan 26, 2022

I saw a difference in the project file between syslog project and other projects. Crossing fingers.

@oblaise
Copy link
Contributor Author

oblaise commented Jan 26, 2022

I saw a difference in the project file between syslog project and other projects. Crossing fingers.

I see I'm missing the version of the packages in the nfproj project also. How can I add them ?

    <Reference Include="System.Threading">
      <HintPath>..\packages\nanoFramework.System.Threading.1.0.4-preview.8\lib\System.Threading.dll</HintPath>
    </Reference>

@josesimoes
Copy link
Member

I saw a difference in the project file between syslog project and other projects. Crossing fingers.

I see I'm missing the version of the packages in the nfproj project also. How can I add them ?

    <Reference Include="System.Threading">
      <HintPath>..\packages\nanoFramework.System.Threading.1.0.4-preview.8\lib\System.Threading.dll</HintPath>
    </Reference>

@oblaise no need to worry with that. But if you want to add these, just copy from one of the other nfprojs that has them.

@oblaise
Copy link
Contributor Author

oblaise commented Jan 26, 2022

I saw a difference in the project file between syslog project and other projects. Crossing fingers.

I see I'm missing the version of the packages in the nfproj project also. How can I add them ?

    <Reference Include="System.Threading">
      <HintPath>..\packages\nanoFramework.System.Threading.1.0.4-preview.8\lib\System.Threading.dll</HintPath>
    </Reference>

@oblaise no need to worry with that. But if you want to add these, just copy from one of the other nfprojs that has them.

So I don't see what I can do more to have the version test to pass.

@josesimoes
Copy link
Member

@oblaise please do not worry about the error in the nanovc check.
As Laurent already mentioned above that's something that needs to be adjusted in our tool. Not your fault.
It's been taken care of. Hopefully all will be OK in the next hour or so.

@josesimoes
Copy link
Member

@oblaise build is 🟢 !!

@josesimoes
Copy link
Member

I've fixed the package.config for you and pushed it to your working branch.

- General improvements in comments.
- Rename some parameters for clarity.
- Add links in comments.
- Fix syslog names and typos for coherency.
- Wrap parameters.
- Fix formatting and code style.
@josesimoes
Copy link
Member

@oblaise did one last pass with a few more improvements. Please review and comment back if you find anything wrong and/or misplaced.

Copy link
Contributor Author

@oblaise oblaise left a comment

Choose a reason for hiding this comment

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

OK for me.
Give me a few minutes I will insert the comments in Facility/Severity.

@oblaise
Copy link
Contributor Author

oblaise commented Jan 26, 2022

OK for me. Give me a few minutes I will insert the comments in Facility/Severity.

@josesimoes how can I push your latest commit to my repo ?

Copy link
Member

@josesimoes josesimoes left a comment

Choose a reason for hiding this comment

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

All good now!!

@josesimoes josesimoes changed the title Syslog ILogger provider Add Syslog ILogger provider Jan 26, 2022
@josesimoes josesimoes merged commit 7210978 into nanoframework:develop Jan 26, 2022
@nfbot
Copy link
Member

nfbot commented Jan 26, 2022

@oblaise thank you again for your contribution! 🙏😄

.NET nanoFramework it's all about community involvement and no contribution is too small.
We would like to invite you to join the project Contributors list.

Please edit it and add an entry with your GitHub user in the appropriate location (names sorted alphabetically):

  <tr>
    <td><img src="https://github.com/oblaise.png?size=50&" height="50" width="50" ></td>
    <td><a href="https://github.com/oblaise"></a></td>
  </tr>

(feel free to adjust your name, if it's not correct)

@oblaise oblaise deleted the Syslog branch January 28, 2022 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Documentation Improvements or additions to documentation Type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants