Reputation: 10820
I am looking for a high performance logging library that I will use on an embedded device.
I also want to say that I previously used PaulBunyan logging library which provided an efficient method for transferring information.
[By efficient I meant it had a solution for transferring only the __LINE__
and __FILE__
when sending data through a low speed interface (SERIAL for example) - of course a __LINE__
__FILE__
mapping was previously made by scanning the code].
Do you know such solutions or at least similar ones?
Upvotes: 1
Views: 2379
Reputation: 10820
The decision is to implement this since no open alternatives are available.
Upvotes: 2
Reputation: 1
The best thing to do is to use the same logging library you mentioned but having the OS-specific codes (like: line number, file name, serial comms) separate from the logical code. The OS-specific code must be contained in functions or macros and then called in from the logical code.
Example:
#OS_LINE _LINE_
#OS_FILE _FILE_
#OS_SEND(a) Send(a)
int log(void)
{
char msg[50];
sprintf(msg, "line %i, %s", OS_LINE, OS_FILE);
OS_SEND(msg);
return 0;
}
With this you can re-use the library by just changing the OS specific Macros for each device.
Upvotes: 0