How to log string without surrounded double quotes ?
See original GitHub issuestring m = "message";
logger.Debug("A message: {Message}.", m);
output:
A message: "message".
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
I want to remove double quotes from a String
Assuming: var someStr = 'He said "Hello, my name is Foo"'; console.log(someStr.replace(/['"]+/g, ''));. That should do the trick.
Read more >Remove Beginning and Ending Double Quotes from a String
In this tutorial, we'll study different approaches for removing beginning and ending double quotes from a String in Java.
Read more >bash - Why quotes are retained in string variables when ...
A double quote may be quoted within double quotes by preceding it with a backslash. If enabled, history expansion will be performed unless...
Read more >JavaScript Strings: The Basic Methods and Functions
Strings in JavaScript are contained within a pair of either single quotation marks '' or double quotation marks "". Both quotes represent Strings...
Read more >How to remove Quotes from a String in JavaScript
If you need to remove the double and single quotes from a string, use the logical AND (&&) operator. index.js. Copied! const str...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can also do use the
:l
format parameter (l = literal
) to avoid the quotes:But yes you can make it application wide by replacing
IValueFormatter
like this:And register it like this:
NLog.Config.ConfigurationItemFactory.Default.ValueFormatter is deprecated.
A new way to add the OverrideValueFormatter from @snakefoot would be to define a static method In the Formatter:
This can than be called f.e. with
LogManager.Configuration = OverrideValueFormatter.AssignToConfiguration(LogManager.Configuration);