Private
Public Access
2
0

syslog: remove all fprintf calls and use syslog instead

Syslog is now used for all error messages, return values in the code should be
used by programmers to see the status of the library/board and syslog can be
used to see quickly from a debugging perspective what has gone wrong. A few
cosmetics where improved as well as a mraa_set_log_level() call where the
syslog log mask can be set directly from libmraa.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-09-25 14:31:04 +01:00
parent 68de395fea
commit 32d8a6f0ca
12 changed files with 184 additions and 131 deletions

View File

@@ -22,15 +22,22 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "stdio.h"
#include <stdio.h>
#include <syslog.h>
//! [Interesting]
#include "mraa.h"
int
main(int argc, char **argv)
{
mraa_result_t ret;
ret = mraa_set_log_level(LOG_DEBUG);
fprintf(stdout, "hello mraa\n Version: %s\n", mraa_get_version());
mraa_deinit();
return 0;
return ret;
}
//! [Interesting]