This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi Guys,
Currenly looking to add some conditional tracing to a project using lightspeed and would like to make a feature request:
Ideally I'd like to do my own log formatting and not use the lightspeed inbuilt text format, is there any chance that the logging can be changed in lightspeed to use a richer object than just a sting builder, perhaps with a tostring method that currently contains the output. I'm just thinking of a struct that contains time taken, command sql, result type and list of key value pairs for parameters
would this be possible to add in? I've looked at the code and have achieved a similar thing but would prefer to ensure it's in a core lightspeed dll rather than built off my own machine and deployed.
Many thanks
Owen
|
|
|
That sounds like a cool idea and I've logged a feature request for it. We'll see if we can slip it into 3.0 but no promises! |
|
|
Okay, in LightSpeed 3 the objects passed to LogSql will normally be of the new CommandLog type. I say "normally" because NoSQL providers can still pass strings instead: apply normal defensive techniques when casting. Also note this applies only to LogSql, not LogDebug. CommandLog overrides ToString and provides an explicit string conversion so existing loggers should remain compatible, but it also exposes the command text, parameters, time taken and result as separate properties for custom logging. |
|