[Ovmsdev] access to writer?

Michael Geddes frog at bunyip.wheelycreek.net
Fri Sep 13 21:06:40 HKT 2024


Probably the best you can do is do a log.  If you the do log monitor yes
and enable the channel it will appear.

I think you need to take a step back and say what your original problem is.

Remember multiple 'writers' can be active / temporarily created depending


//.

On Fri, 13 Sept 2024, 20:40 Michael Balzer via OvmsDev, <
ovmsdev at lists.openvehicles.com> wrote:

> The short answer is: you can't.
>
> There is no "current" writer. If a function may need to output text to a
> writer, you need to pass the writer pointer to that function.
>
> In case of functions that may be called within a user command execution
> and shall then provide output, add the writer to the signature, and only
> use it when it's not null. If the output is important, send it to the
> log if the writer is null.
>
> If you need to reduce the output for certain output channels, you'll
> also want to pass the "verbosity" parameter along with the writer pointer.
>
> Regards,
> Michael
>
>
> Am 13.09.24 um 08:55 schrieb sharkcow via OvmsDev:
> > Hi all,
> >
> > I have a dumb question: how do I get access to the current "writer"
> > object in a "regular" function in my vehicle code (not defined by
> > RegisterCommand)?
> >
> > Thanks!
> >
> > sharkcow
> > _______________________________________________
> > OvmsDev mailing list
> > OvmsDev at lists.openvehicles.com
> > http://lists.openvehicles.com/mailman/listinfo/ovmsdev
>
> --
> Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
> Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
>
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.openvehicles.com
> http://lists.openvehicles.com/mailman/listinfo/ovmsdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20240913/2c07d2e5/attachment-0001.htm>


More information about the OvmsDev mailing list