Hi Juan,
We don’t typically use elogs to store strings, still, you may be able to get it
to run with:
struct
{
u8 err[20];
} * ed;
And then copy your data to err: clib_memcpy (ed->err, your_vec, vec_len
(your_vec)). Make sure your vec is 0 terminated.
HTH,
Florin
> On Nov 28, 2017, at 9:12 PM, Juan Salmon <[email protected]> wrote:
>
>
> I want to use event-log and send string to one of elements of ed struct.
> but the result is not correct.
>
> the sample code:
>
> ELOG_TYPE_DECLARE (e) = {
> .format = "Test LOG: %s",
> .format_args = "s20",
> };
> struct
> {
> u8 * err;
> } * ed;
>
>
> vlib_worker_thread_t * w = vlib_worker_threads + cpu_index;
> ed = ELOG_TRACK_DATA (&vlib_global_main.elog_main, e, w->elog_track);
>
> ed->err = format (0,"%s", "This is a Test");
>
>
> Could you please help me?
>
>
> Best Regards,
> Juan Salmon.
> _______________________________________________
> vpp-dev mailing list
> [email protected]
> https://lists.fd.io/mailman/listinfo/vpp-dev
_______________________________________________
vpp-dev mailing list
[email protected]
https://lists.fd.io/mailman/listinfo/vpp-dev