Skip to content

Commit

Permalink
Add serilog example
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Dec 15, 2024
1 parent 81506c0 commit 354a294
Show file tree
Hide file tree
Showing 27 changed files with 311 additions and 25 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ dotnet run
- [Exposed roots via root arg](readme/exposed-roots-via-root-arg.md)
- [Exposed generic roots](readme/exposed-generic-roots.md)
- [Exposed generic roots with args](readme/exposed-generic-roots-with-args.md)
- [Serilog](readme/serilog.md)
### Applications
- Console
- [Schrödinger's cat](readme/Console.md)
Expand Down
12 changes: 9 additions & 3 deletions build/ReadmeTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private static async Task AddContentAsync(string sourceFile, TextWriter readmeWr
foreach (var file in files)
{
var relativePath = Path.GetRelativePath(Environment.CurrentDirectory, file);
Part? part = default;
Part? part = null;
var vars = new Dictionary<string, string>
{
[VisibleKey] = "False",
Expand All @@ -151,7 +151,7 @@ private static async Task AddContentAsync(string sourceFile, TextWriter readmeWr

if (str.StartsWith("*/"))
{
part = default;
part = null;
continue;
}

Expand All @@ -171,7 +171,7 @@ private static async Task AddContentAsync(string sourceFile, TextWriter readmeWr
body.AddRange(localBody.Select(i => i.Length > offset ? i[offset..].TrimEnd() : i));
offset = int.MaxValue;
localBody.Clear();
part = default;
part = null;
continue;
}

Expand Down Expand Up @@ -212,6 +212,12 @@ private static async Task AddContentAsync(string sourceFile, TextWriter readmeWr
}
}

if (line.TrimStart().StartsWith("//# "))
{
localBody.Add(line.Replace("//# ", ""));
continue;
}

localBody.Add(line);
}
}
Expand Down
2 changes: 1 addition & 1 deletion readme/async-root.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ partial class Composition
{
private readonly Composition _root;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public Composition()
{
_root = this;
Expand Down
2 changes: 1 addition & 1 deletion readme/build-up-of-an-existing-generic-object.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ partial class Composition
{
private readonly Composition _root;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public Composition()
{
_root = this;
Expand Down
2 changes: 1 addition & 1 deletion readme/build-up-of-an-existing-object.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ partial class Composition
{
private readonly Composition _root;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public Composition()
{
_root = this;
Expand Down
2 changes: 1 addition & 1 deletion readme/class-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ partial class Composition
private readonly string _argServiceName;
private readonly string _argDependencyName;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public Composition(int id, string serviceName, string dependencyName)
{
_argId = id;
Expand Down
2 changes: 1 addition & 1 deletion readme/complex-generics.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ partial class Composition
private DependencyStruct<int> _singletonDependencyStruct51;
private bool _singletonDependencyStruct51Created;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public Composition()
{
_root = this;
Expand Down
2 changes: 1 addition & 1 deletion readme/constructor-ordinal-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ partial class Composition

private readonly string _argServiceName;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public Composition(string serviceName)
{
_argServiceName = serviceName ?? throw new ArgumentNullException(nameof(serviceName));
Expand Down
2 changes: 1 addition & 1 deletion readme/custom-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ partial class PersonComposition

private readonly int _argPersonId;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public PersonComposition(int personId)
{
_argPersonId = personId;
Expand Down
2 changes: 1 addition & 1 deletion readme/custom-universal-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ partial class PersonComposition

private readonly int _argPersonId;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public PersonComposition(int personId)
{
_argPersonId = personId;
Expand Down
2 changes: 1 addition & 1 deletion readme/exposed-generic-roots-with-args.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ partial class Composition

private Integration.CompositionWithGenericRootsAndArgsInOtherProject? _singletonCompositionWithGenericRootsAndArgsInOtherProject44;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public Composition()
{
_root = this;
Expand Down
2 changes: 1 addition & 1 deletion readme/exposed-roots-via-arg.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ partial class Composition

private readonly Integration.CompositionInOtherProject _argBaseComposition;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public Composition(Integration.CompositionInOtherProject baseComposition)
{
_argBaseComposition = baseComposition ?? throw new ArgumentNullException(nameof(baseComposition));
Expand Down
2 changes: 1 addition & 1 deletion readme/exposed-roots-via-root-arg.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ partial class Composition
{
private readonly Composition _root;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public Composition()
{
_root = this;
Expand Down
2 changes: 1 addition & 1 deletion readme/factory.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ partial class Composition
{
private readonly Composition _root;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public Composition()
{
_root = this;
Expand Down
2 changes: 1 addition & 1 deletion readme/generic-async-composition-roots-with-constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ partial class Composition
{
private readonly Composition _root;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public Composition()
{
_root = this;
Expand Down
2 changes: 1 addition & 1 deletion readme/generic-root-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ partial class Composition
{
private readonly Composition _root;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public Composition()
{
_root = this;
Expand Down
2 changes: 1 addition & 1 deletion readme/inject-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ partial class PersonComposition

private readonly int _argPersonId;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public PersonComposition(int personId)
{
_argPersonId = personId;
Expand Down
2 changes: 1 addition & 1 deletion readme/manually-started-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ partial class Composition
{
private readonly Composition _root;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public Composition()
{
_root = this;
Expand Down
2 changes: 1 addition & 1 deletion readme/member-ordinal-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ partial class PersonComposition
private readonly string _argPersonName;
private readonly DateTime _argPersonBirthday;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public PersonComposition(int personId, string personName, DateTime personBirthday)
{
_argPersonId = personId;
Expand Down
2 changes: 1 addition & 1 deletion readme/ondependencyinjection-hint.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ partial class Composition
{
private readonly Composition _root;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public Composition()
{
_root = this;
Expand Down
2 changes: 1 addition & 1 deletion readme/required-properties-or-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ partial class Composition

private readonly string _argName;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public Composition(string name)
{
_argName = name ?? throw new ArgumentNullException(nameof(name));
Expand Down
2 changes: 1 addition & 1 deletion readme/root-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ partial class Composition
{
private readonly Composition _root;

[OrdinalAttribute(10)]
[OrdinalAttribute(128)]
public Composition()
{
_root = this;
Expand Down
Loading

0 comments on commit 354a294

Please sign in to comment.