Adds Logging level control to UICatalog (#3938)

* Tons of API doc updates

* Added logging control to UICatalog

* Added logging control to UICatalog - more

* fixed minor issues

* removed logs from .gitignore

* Fixed log file path

* Fixed app desc
This commit is contained in:
Tig
2025-02-28 15:06:01 -07:00
committed by GitHub
parent c88c772462
commit 79cd4e92b7
20 changed files with 396 additions and 194 deletions

View File

@@ -45,8 +45,8 @@ public class KeyJsonConverterTests
// Arrange
// Act
string json = JsonSerializer.Serialize ((Key)key, ConfigurationManager._serializerOptions);
var deserializedKey = JsonSerializer.Deserialize<Key> (json, ConfigurationManager._serializerOptions);
string json = JsonSerializer.Serialize ((Key)key, ConfigurationManager.SerializerOptions);
var deserializedKey = JsonSerializer.Deserialize<Key> (json, ConfigurationManager.SerializerOptions);
// Assert
Assert.Equal (expectedStringTo, deserializedKey.ToString ());
@@ -60,7 +60,7 @@ public class KeyJsonConverterTests
// Act
string json = "\"Ctrl+Q\"";
Key deserializedKey = JsonSerializer.Deserialize<Key> (json, ConfigurationManager._serializerOptions);
Key deserializedKey = JsonSerializer.Deserialize<Key> (json, ConfigurationManager.SerializerOptions);
// Assert
Assert.Equal (key, deserializedKey);
@@ -70,7 +70,7 @@ public class KeyJsonConverterTests
public void Separator_Property_Serializes_As_Glyph ()
{
// Act
string json = JsonSerializer.Serialize (Key.Separator, ConfigurationManager._serializerOptions);
string json = JsonSerializer.Serialize (Key.Separator, ConfigurationManager.SerializerOptions);
// Assert
Assert.Equal ($"\"{Key.Separator}\"", json);
@@ -85,7 +85,7 @@ public class KeyJsonConverterTests
{
// Act
Key.Separator = (Rune)'*';
string json = JsonSerializer.Serialize (Key.Separator, ConfigurationManager._serializerOptions);
string json = JsonSerializer.Serialize (Key.Separator, ConfigurationManager.SerializerOptions);
// Assert
Assert.Equal ("\"*\"", json);
@@ -124,7 +124,7 @@ public class KeyJsonConverterTests
// Act
Key.Separator = (Rune)separator;
Key deserializedKey = JsonSerializer.Deserialize<Key> (json, ConfigurationManager._serializerOptions);
Key deserializedKey = JsonSerializer.Deserialize<Key> (json, ConfigurationManager.SerializerOptions);
Key expectedKey = new Key ((KeyCode)keyChar).WithCtrl.WithAlt;
// Assert

View File

@@ -31,13 +31,13 @@ public class RuneJsonConverterTests
public void RoundTripConversion_Negative (string rune)
{
// Act
string json = JsonSerializer.Serialize (rune, ConfigurationManager._serializerOptions);
string json = JsonSerializer.Serialize (rune, ConfigurationManager.SerializerOptions);
// Assert
Assert.Throws<JsonException> (
() => JsonSerializer.Deserialize<Rune> (
json,
ConfigurationManager._serializerOptions
ConfigurationManager.SerializerOptions
)
);
}
@@ -61,8 +61,8 @@ public class RuneJsonConverterTests
// Arrange
// Act
string json = JsonSerializer.Serialize (rune, ConfigurationManager._serializerOptions);
var deserialized = JsonSerializer.Deserialize<Rune> (json, ConfigurationManager._serializerOptions);
string json = JsonSerializer.Serialize (rune, ConfigurationManager.SerializerOptions);
var deserialized = JsonSerializer.Deserialize<Rune> (json, ConfigurationManager.SerializerOptions);
// Assert
Assert.Equal (expected, deserialized.ToString ());
@@ -74,7 +74,7 @@ public class RuneJsonConverterTests
// Arrange
// Act
string json = JsonSerializer.Serialize ((Rune)'a', ConfigurationManager._serializerOptions);
string json = JsonSerializer.Serialize ((Rune)'a', ConfigurationManager.SerializerOptions);
// Assert
Assert.Equal ("\"a\"", json);
@@ -86,7 +86,7 @@ public class RuneJsonConverterTests
// Arrange
// Act
string json = JsonSerializer.Serialize ((Rune)0x01, ConfigurationManager._serializerOptions);
string json = JsonSerializer.Serialize ((Rune)0x01, ConfigurationManager.SerializerOptions);
// Assert
Assert.Equal ("\"\\u0001\"", json);
@@ -99,7 +99,7 @@ public class RuneJsonConverterTests
var json = "\"a\"";
// Act
var deserialized = JsonSerializer.Deserialize<Rune> (json, ConfigurationManager._serializerOptions);
var deserialized = JsonSerializer.Deserialize<Rune> (json, ConfigurationManager.SerializerOptions);
// Assert
Assert.Equal ("a", deserialized.ToString ());
@@ -112,7 +112,7 @@ public class RuneJsonConverterTests
var json = "\"\\u0061\"";
// Act
var deserialized = JsonSerializer.Deserialize<Rune> (json, ConfigurationManager._serializerOptions);
var deserialized = JsonSerializer.Deserialize<Rune> (json, ConfigurationManager.SerializerOptions);
// Assert
Assert.Equal ("a", deserialized.ToString ());
@@ -125,7 +125,7 @@ public class RuneJsonConverterTests
var json = "\"U+0061\"";
// Act
var deserialized = JsonSerializer.Deserialize<Rune> (json, ConfigurationManager._serializerOptions);
var deserialized = JsonSerializer.Deserialize<Rune> (json, ConfigurationManager.SerializerOptions);
// Assert
Assert.Equal ("a", deserialized.ToString ());
@@ -138,7 +138,7 @@ public class RuneJsonConverterTests
var json = "97";
// Act
var deserialized = JsonSerializer.Deserialize<Rune> (json, ConfigurationManager._serializerOptions);
var deserialized = JsonSerializer.Deserialize<Rune> (json, ConfigurationManager.SerializerOptions);
// Assert
Assert.Equal ("a", deserialized.ToString ());

View File

@@ -475,19 +475,19 @@ public class MessageBoxTests
string expectedText = """
UI Catalog: A comprehensive sample library for
_______ _ _ _____ _
|__ __| (_) | | / ____| (_)
| | ___ _ __ _ __ ___ _ _ __ __ _| || | __ _ _ _
| |/ _ \ '__| '_ ` _ \| | '_ \ / _` | || | |_ | | | | |
| | __/ | | | | | | | | | | | (_| | || |__| | |_| | |
|_|\___|_| |_| |_| |_|_|_| |_|\__,_|_(_)_____|\__,_|_|
v2 - Pre-Alpha
Ok
UI Catalog: A comprehensive sample library and test app for
_______ _ _ _____ _
|__ __| (_) | | / ____| (_)
| | ___ _ __ _ __ ___ _ _ __ __ _| || | __ _ _ _
| |/ _ \ '__| '_ ` _ \| | '_ \ / _` | || | |_ | | | | |
| | __/ | | | | | | | | | | | (_| | || |__| | |_| | |
|_|\___|_| |_| |_| |_|_|_| |_|\__,_|_(_)_____|\__,_|_|
v2 - Pre-Alpha
Ok
""";

View File

@@ -6188,7 +6188,7 @@ ek")]
};
Size tfSize = tf.FormatAndGetSize ();
Assert.Equal (new (58, 13), tfSize);
Assert.Equal (new (59, 13), tfSize);
((FakeDriver)Application.Driver).SetBufferSize (tfSize.Width, tfSize.Height);
@@ -6196,19 +6196,19 @@ ek")]
tf.Draw (Application.Screen, Attribute.Default, Attribute.Default);
var expectedText = """
******UI Catalog: A comprehensive sample library for******
**********************************************************
_______ _ _ _____ _
|__ __| (_) | | / ____| (_)
| | ___ _ __ _ __ ___ _ _ __ __ _| || | __ _ _ _
| |/ _ \ '__| '_ ` _ \| | '_ \ / _` | || | |_ | | | | |
| | __/ | | | | | | | | | | | (_| | || |__| | |_| | |
|_|\___|_| |_| |_| |_|_|_| |_|\__,_|_(_)_____|\__,_|_|
**********************************************************
**********************v2 - Pre-Alpha**********************
**********************************************************
**********https://github.com/gui-cs/Terminal.Gui**********
**********************************************************
UI Catalog: A comprehensive sample library and test app for
***********************************************************
_______ _ _ _____ _ *
|__ __| (_) | | / ____| (_)*
| | ___ _ __ _ __ ___ _ _ __ __ _| || | __ _ _ _ *
| |/ _ \ '__| '_ ` _ \| | '_ \ / _` | || | |_ | | | | |*
| | __/ | | | | | | | | | | | (_| | || |__| | |_| | |*
|_|\___|_| |_| |_| |_|_|_| |_|\__,_|_(_)_____|\__,_|_|*
***********************************************************
**********************v2 - Pre-Alpha***********************
***********************************************************
**********https://github.com/gui-cs/Terminal.Gui***********
***********************************************************
""";
TestHelpers.AssertDriverContentsAre (expectedText.ReplaceLineEndings (), _output);