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

Add message.name to literate logger #241

Closed
haf opened this issue Apr 11, 2017 · 3 comments
Closed

Add message.name to literate logger #241

haf opened this issue Apr 11, 2017 · 3 comments
Milestone

Comments

@haf
Copy link
Member

haf commented Apr 11, 2017

    @ [ " ", Subtext
        "<", Punctuation
        String.concat "." message.name, Subtext
        ">", Punctuation
      ]

in literateDefaultTokeniser.

@adamchester
Copy link
Contributor

Are we talking about Logary proper here?

In the Facade, we can change the outputTemplate to include the {source} value:

let loggerTemplate = LiterateFormatting.tokeniserForOutputTemplate "[{level}] {timestampUtc:u} {message} [{source}]{exceptions}"
let singleLetterLogLevel = function Verbose->"V" |Debug->"D" |Info->"I" |Warn->"W" |Error->"E" |Fatal->"F"
let loggerOptions = { Literate.LiterateOptions.create() with getLogLevelText = singleLetterLogLevel }
let logger = LiterateConsoleTarget([|"Suave";"Example"|], Debug, options=loggerOptions, literateTokeniser=loggerTemplate) :> Logger 

screen shot 2017-02-10 at 12 09 24

@adamchester
Copy link
Contributor

I wonder if now would be a good time to add a similar feature to Logary proper?

@haf
Copy link
Member Author

haf commented Apr 12, 2017

Nice, that would be good to put in the docs; I ended up modifying the default tokeniser in the Facade, like you'll see in the commits.

Feature parity is always a good idea :)

@lust4life lust4life added this to the v5.0 milestone Dec 11, 2017
@haf haf closed this as completed in efb55b2 Feb 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants