diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-02-11 14:20:40 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-02-11 14:20:40 +0000 |
commit | 75e67f05d4b97efc32d95b478ec1c1f959992a4b (patch) | |
tree | 8cf471347f767130a152b249bafd7de1a6017757 /nuttx/lib/stdio/lib_rawprintf.c | |
parent | 4a62de545bf87610c2415218e144ddef4dd0e75c (diff) | |
download | px4-nuttx-75e67f05d4b97efc32d95b478ec1c1f959992a4b.tar.gz px4-nuttx-75e67f05d4b97efc32d95b478ec1c1f959992a4b.tar.bz2 px4-nuttx-75e67f05d4b97efc32d95b478ec1c1f959992a4b.zip |
Add logic to re-direct debug output to a sysloggin device
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4381 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/lib/stdio/lib_rawprintf.c')
-rw-r--r-- | nuttx/lib/stdio/lib_rawprintf.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/nuttx/lib/stdio/lib_rawprintf.c b/nuttx/lib/stdio/lib_rawprintf.c index 915fd833b..d738b212a 100644 --- a/nuttx/lib/stdio/lib_rawprintf.c +++ b/nuttx/lib/stdio/lib_rawprintf.c @@ -1,8 +1,8 @@ /**************************************************************************** * lib/stdio/lib_rawprintf.c * - * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -83,7 +83,18 @@ int lib_rawvprintf(const char *fmt, va_list ap) { -#if CONFIG_NFILE_DESCRIPTORS > 0 +#if defined(CONFIG_SYSLOG) + + struct lib_outstream_s stream; + + /* Wrap the low-level output in a stream object and let lib_vsprintf + * do the work. + */ + + lib_syslogstream((FAR struct lib_outstream_s *)&stream); + return lib_vsprintf((FAR struct lib_outstream_s *)&stream, fmt, ap); + +#elif CONFIG_NFILE_DESCRIPTORS > 0 struct lib_rawoutstream_s rawoutstream; |