korfuri/golog — comment on commit f59657e98b0ff81cf4e1325241ab5434cfba1e3c
File: log_outer.go line 31
By korfuri:

That's not a problem with my proposition, as long as you keep a way of representing any location in any outer. Here I make the easy choice, which is to force each location to have a human-readable representation. It is compatible with what you say here.

On the other hand it is not compatible with some more elaborate use cases, like, when logging to XML, having "foo.go42" and when logging to a plain-text file, having "foo.go:42". But your outer could format it as "foo.go:42". It is still possible to support an extensible serialization to string but that'd be much more convoluted.

Maybe you can add some level of detail by having several methods to have a more or less detailed level of information about location written to the buffer. The format, though, would still be up to the LogLocation implementation.