{"id":14484293,"name":"log.assert","ecosystem":"nuget","description":"Log.Assert and Serilog.Assert add assertion-style application logging to ILogger.\n```\nlog.Me();\nlog.PreconditionNotNull(target);\n\nvar graphemes = new StringInfo(target??\"\");\nlog.Assert(graphemes.LengthInTextElements \u003e 0);\n\nlog.Precondition(0 \u003c= guess \u0026\u0026 guess \u003c= graphemes.LengthInTextElements);\n\nlog.ExceptionAndThrowIf(\n    graphemes.SubstringByTextElements(guess,1) is \"💥\",\n    new ApplicationException(\"bang!\"));\n\nvar remainder = Remove(graphemes,guess);\nlog.DebugIf(remainder.Length == 0,usefulState: \"TBC:is this permitted?\");\nlog.If(graphemes.LengthInTextElements \u003e 0,\n          usefulState: (target,guess,graphemes.LengthInTextElements),\n          label: \"Remaining after Removal\");\n\nlog.PreconditionNotNull(target);\nlog.Postcondition(remainder.Length \u003c target.Length);\nlog.Me(remainder);\nreturn remainder;\n```\n## What is Logged?\n \n- All methods log the current method or member name.\n- Assertions, Pre-, and Post-Conditions log nothing at all if they pass.\n- Assertions, Pre-, and Post-Conditions log the literal failed expression if they fail.\n- log.If() logs nothing at all if the condition is false\n- log.If() logs the literal condition expression if it is true\n- All methods can log additional information, either auto-labelled or explicitly labelled.\n\n```\nlog.Me()\n\nlog.Assert()\nlog.AssertNotNull()\nlog.Precondition()\nlog.PreconditionNotNull()\nlog.Postcondition()\nlog.PostconditionNotNull()\n\nlog.AssertElseThrow()\nlog.AssertNotNullElseThrow()\nlog.PreconditionElseThrow()\nlog.PreconditionNotNullElseThrow()\nlog.PostconditionElseThrow()\nlog.PostconditionNotNullElseThrow()\n\nlog.If()\nlog.IfNot()\n```\nand\n\n```\nlog.InformationIf()\nlog.TraceIf()\nlog.DebugIf()\nlog.WarnIf()\nlog.ErrorIf()\nlog.CriticalIf()\n\nlog.InformationIfNot()\nlog.TraceIfNot()\nlog.DebugIfNot()\nlog.WarnIfNot()\nlog.ErrorIfNot()\nlog.CriticalIfNot()\nlog.ExceptionIf()\nlog.ExceptionAndThrowIf()\nlog.Exception()\nlog.ExceptionAndThrow()\nlog.CriticalThenThrow()\nlog.CriticalExceptionThenExitProcessWithCode()\n```","homepage":"https://github.com/chrisfcarroll/Log.Assert","licenses":"LGPL-2.1-or-later","normalized_licenses":["LGPL-2.1-or-later"],"repository_url":"https://github.com/chrisfcarroll/Log.Assert","keywords_array":["logging","monitoring","assertions","debug","CallerArgumentExpression","Serilog","Microsoft.Extensions.Logging"],"namespace":null,"versions_count":3,"first_release_published_at":"2026-05-21T20:40:26.237Z","latest_release_published_at":"2026-05-25T16:37:33.123Z","latest_release_number":"0.3.0-pre1","last_synced_at":"2026-05-25T16:47:02.829Z","created_at":"2026-05-21T21:00:40.139Z","updated_at":"2026-05-25T16:47:30.814Z","registry_url":"https://www.nuget.org/packages/log.assert/","install_command":"Install-Package log.assert","documentation_url":null,"metadata":{"copyright":"(c) Chris F. Carroll, 2023-2026","license_info":{"type":"expression","text":"LGPL-2.1-or-later","version":null},"license_url":"https://licenses.nuget.org/LGPL-2.1-or-later","require_license_acceptance":false,"readme":"README.md","repository":{"type":"git","url":"https://github.com/chrisfcarroll/Log.Assert","branch":null,"commit":"5ecd354e66af18d82e99f900af1cd2e94b5eb158"},"development_dependency":false,"serviceable":false,"framework_assemblies":[],"package_types":[],"release_notes":"ChangeLog\n      ---------\n      0.2    Downgrade dependencies (Serilog 2.10, Extensions.Logging..Abstraction fx.0.0)\n      0.1    First release","dependency_summary":{"total_dependency_groups":3,"target_frameworks":["net6.0","net8.0","net10.0"],"total_dependencies":3}},"repo_metadata":{},"repo_metadata_updated_at":"2026-05-25T16:47:30.794Z","dependent_packages_count":0,"downloads":null,"downloads_period":"total","dependent_repos_count":0,"rankings":{"downloads":null,"dependent_repos_count":5.968960808462663,"dependent_packages_count":15.953941044636357,"stargazers_count":null,"forks_count":null,"docker_downloads_count":null,"average":10.96145092654951},"purl":"pkg:nuget/log.assert","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/nuget/log.assert","docker_dependents_count":null,"docker_downloads_count":null,"usage_url":"https://repos.ecosyste.ms/usage/nuget/log.assert","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/nuget/log.assert/dependencies","status":null,"funding_links":[],"critical":null,"issue_metadata":null,"versions_url":"https://packages.ecosyste.ms/api/v1/registries/nuget.org/packages/log.assert/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/nuget.org/packages/log.assert/version_numbers","latest_version_url":"https://packages.ecosyste.ms/api/v1/registries/nuget.org/packages/log.assert/latest_version","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/nuget.org/packages/log.assert/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/nuget.org/packages/log.assert/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/nuget.org/packages/log.assert/codemeta","maintainers":[]}