Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional Layout Renderer "Assembly-Name" #246

Merged
3 commits merged into from
May 22, 2014
Merged

Conversation

CitizenBean
Copy link

Added a new layout renderer "assembly-name" and the unit test for the new layout renderer. This should replace the current assembly-version layout renderer as this one incorporates the version.

The rendering options should be similar to the exception and processinfo layout renderers.

Configuration Syntax

${assembly-name:Format=string:Separator=string:ShowDisplayNames=Boolean:RetrieveMethod=enum}

Rendering Options

  • Format
    The format of the output. Must be a comma-separated list of assembly name properties.
    These properties may include: Name,Version,Culture,PublicKeyToken. Properties are case-insensitive.
    The default for this parameter is: Name, Version.
  • Separator
    Used to concatenate parts specified in the Format.
    Defaults to:", " without the quotes
  • ShowDisplayNames
    Used to specify whether the display name for each property should be display in the output.
    Defaults to: False
    Example: Given the following layout ${assembly-name:name,version,culture}
    if ShowDisplayNames is true the following will be output:
    Name=Example, Version=1.0.0.0, Culture=en
    if ShowDisplayNames is false the following will be output:
    Example, 1.0.0.0, en
  • RetrieveMethod
    • EntryAssembly - Use GetEntryAssembly method from System.Reflection.Assembly. This has the effect of retrieving the process executable in the default application domain.
    • ExecutingAssembly - Use GetExecutingAssembly method from System.Reflection.Assembly. This has the effect of retrieving the assembly that contains the code that is currently executing.
    • CallingAssembly - Use GetCallingAssembly method from System.Reflection.Assembly. This has the effect of retrieving the assembly that invoked the currently executing method.
    • TestAssembly - This is only used for testing purposes within the unit tests. This was required due to the unit tests not retrieving a usable assembly resulting in empty output. Currently this is set to create a fake assembly name with the full name as: "ExampleAssembly, Version=1.0.0.0, Culture=en, PublicKeyToken=a5d015c7d5a0b012"
    • EmptyAssembly - This will set the assembly name to be null. Used within unit tests to have a controlled test if an assembly was not retrievable.

@ghost
Copy link

ghost commented May 22, 2014

Sorry for the logn delay, I've totally missed this pull request. Could you create some unit tests for this?

@ghost
Copy link

ghost commented May 22, 2014

Just found the unit tests. I'll merge it right away. Could you create some documentation for this feature

ghost pushed a commit that referenced this pull request May 22, 2014
Additional Layout Renderer "Assembly-Name"
@ghost ghost merged commit 47d9740 into NLog:master May 22, 2014
@ghost ghost added the feature label May 22, 2014
@ghost ghost added this to the 3.0 milestone May 22, 2014
@ghost
Copy link

ghost commented Jun 2, 2014

This doesn't compile

@ghost ghost removed this from the 3.0 milestone Jun 2, 2014
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant