Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

How FormattedLogValues is working ? #694

@WernerMairl

Description

@WernerMairl

Hi
i see a unexpected behavior, not sure if i'm doing something wrong....
(using .net Core 2.0.0 and packages in version 2.0.0)

Assuming that the following extension method is working like string.Format!

public static void LogTrace(this ILogger logger, string message, params object[] args)
the following sample should return 2 idenical trace strings!

string s = string.Format("{1} Bytes Markdown written to '{0}'", fn, markdown.Length);
this.Logger.LogTrace(s);
this.Logger.LogTrace("{1} Bytes Markdown written to '{0}'", fn, markdown.Length);

returns the following output on the Console-Logger (different strings)

trce: XXX[0]
352 Bytes Markdown written to 'c:\xxx.md'
trce: XXX[0]
c:\xxx.md Bytes Markdown written to '352'

This is a known issue/behavior ?
assuming that the problem comes from using format placeholder {0},{1} ordered in DESC not ASC
"{1} Bytess Markdown written to '{0}'"

internally the string calculation is done in the class FormattedLogValues, so i'm assuming that the behavior comes from there....

regards
Werner

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions