Skip to content

Commit

Permalink
Merge pull request #1 from chickensoft-games/doc/readme-paramlist
Browse files Browse the repository at this point in the history
doc: update readme for Log parameter array
  • Loading branch information
wlsnmrk authored Feb 4, 2025
2 parents 976e43b + 29f26b7 commit 9886702
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ For an overview of the logging system, see [Chickensoft.Log][chickensoft-log-gh]
public class MyClass
{
// Create a log with the name of MyClass, outputting to the Godot debug console
private ILog _log = new Log(nameof(MyClass), [new GDWriter()]);
private ILog _log = new Log(nameof(MyClass), new GDWriter());
}
```

Expand All @@ -60,8 +60,8 @@ public void MyMethod()
}
catch (Exception e)
{
// Outputs the value of e.ToString(), prefixed by a line labeling it an exception,
// as an error
// Outputs the value of e.ToString(), prefixed by a line labeling it an
// exception, as an error
_log.Print(e);
}

Expand Down Expand Up @@ -92,7 +92,7 @@ Create a log that outputs messages to the default filename `"user://output.log"`
```csharp
public class MyClass
{
private ILog _log = new Log(nameof(MyClass), [GDFileWriter.Instance()]);
private ILog _log = new Log(nameof(MyClass), GDFileWriter.Instance());
}
```

Expand All @@ -102,7 +102,8 @@ Create a log that outputs messages to a custom filename:
```csharp
public class MyClass
{
private ILog _log = new Log(nameof(MyClass), [GDFileWriter.Instance("user://CustomFileName.log")]);
private ILog _log = new Log(nameof(MyClass),
GDFileWriter.Instance("user://CustomFileName.log"));
}
```

Expand All @@ -121,12 +122,13 @@ public class Entry

public class MyClass
{
private ILog _log = new Log(nameof(MyClass), [GDFileWriter.Instance()]);
private ILog _log = new Log(nameof(MyClass), GDFileWriter.Instance());
}
```

> [!WARNING]
> Changing the default value for the log file name will affect newly-created `GDFileWriter`s, but will not affect ones that already exist.
> Changing the default value for the log file name will affect newly-created
> `GDFileWriter`s, but will not affect ones that already exist.
## 💁 Getting Help

Expand Down

0 comments on commit 9886702

Please sign in to comment.