SYNCE_ERROR(3) http://www.synce.org/ SYNCE_ERROR(3)NAME
synce_error - error reporting functions
SYNOPSIS
#include <synce_log.h>
void _synce_log(int level, const char* file, int line, const *char format, ... );
void synce_error(const *char format, ... );
void synce_warning(const *char format, ... );
void synce_info(const *char format, ... );
void synce_debug(const *char format, ... );
void synce_trace(const *char format, ... );
void synce_warning_unless(bool condition, const *char format, ... );
void synce_log_set_level(int level);
void synce_log_use_syslog(void);
DESCRIPTION
The various synce_xxx() logging functions are implemented as macros calling the underlying _synce_log function, but are presented here as
they should be used for clarity. All accept a format string and optional arguements in the same way as printf(3). synce_debug() and
synce_trace() are equivalent.
synce_warning_unless() will only take action if cond evaluates to a false value.
These functions will as standard log to stdout. synce_log_use_syslog() will cause the output to be sent to syslog at the appropriate pri-
ority.
synce_log_set_level() sets the maximum priority level that will actually be output, whether to stdout or syslog, with the default maximum
level being warning.
The following defines are available, their equivalent syslog priorities are also shown.
SYNCE_LOG_LEVEL_ERROR LOG_ERR
SYNCE_LOG_LEVEL_WARNING LOG_WARNING
SYNCE_LOG_LEVEL_INFO LOG_INFO
SYNCE_LOG_LEVEL_DEBUG LOG_DEBUG
SYNCE_LOG_LEVEL_TRACE LOG_DEBUG
The following are also available for use with synce_log_set_level()
SYNCE_LOG_LEVEL_LOWEST
SYNCE_LOG_LEVEL_HIGHEST
SYNCE_LOG_LEVEL_DEFAULT
SEE ALSO synce(7)The SynCE Project 2008-02-23 SYNCE_ERROR(3)
Check Out this Related Man Page
vsyslog(3C) Standard C Library Functions vsyslog(3C)NAME
vsyslog - log message with a stdarg argument list
SYNOPSIS
#include <syslog.h>
#include <stdarg.h>
void vsyslog(int priority, const char *message, va_list ap);
DESCRIPTION
The vsyslog() function is identical to syslog(3C), except that it is called with an argument list as defined by <stdarg.h> rather than with
a variable number of arguments.
EXAMPLES
Example 1 Use vsyslog() to write an error routine.
The following example demonstrates the use of vsyslog() in writing an error routine.
#include <syslog.h>
#include <stdarg.h>
/*
* error should be called like:
* error(pri, function_name, format, arg1, arg2...);
*/
void
error(int pri, char *function_name, char *format, ...)
{
va_list args;
va_start(args, format);
/* log name of function causing error */
(void) syslog(pri, "ERROR in %s.", function_name);
/* log remainder of message */
(void) vsyslog(pri, format, args);
va_end(args);
(void) abort( );
}
main()
{
error(LOG_ERR, "main", "process %d is dying", getpid());
}
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO syslog(3C), attributes(5)SunOS 5.11 30 Aug 2006 vsyslog(3C)
I have a huge matrix file containing some 1.5 million rows and 6000 columns. The matrix looks something like this:
1 2 3
4 5 6
7 8 9
3 4 5
I want to add all the numbers in the columns of this matrix and display the result to my stdout. This means that the numbers in the first column are:
... (2 Replies)
Hi,
Just trying to get to grips with sed and awk for some reporting for work and I need some assistance:
I have a file that lists policy names on the first line and then on the second line whether the policy is active or not.
Policy Name: Policy1
Active: yes
Policy... (8 Replies)
version info :
vi availabe with RHEL 5.4
I have a text file with 10,000 lines. I want to copy lines from 5000th line to 7000th and redirect to a file. Any idea how I can do this?
Note:
The above scenario is just an example. In my actual requirement, the file has 14 million lines and I want... (9 Replies)
Hi everyone,
I know the following questions are noobish questions but I am asking them because I am confused about the basics of history behind UNIX and LINUX.
Ok onto business, my questions are-:
Was/Is UNIX ever an open source operating system ?
If UNIX was... (21 Replies)
Hello,
I couldn't find an actual introduction thread, so I decided to just put this here.
I go by d0wngrade online. I have been programming in multiple languages for about 15+ years. I started with standard web design languages like HTML and CSS, but I then advanced from design to development... (2 Replies)
Hi guys...
The first active code line in AudioScope.sh is set -u .
This causes a complete exit if a variable is used/found but has not been allocated at the start of the program.
However, apart from writing code to do the task, is there a switch to to check which variables have been... (17 Replies)
Hi.
In thread https://www.unix.com/shell-programming-and-scripting/267833-grouping-counting.html rovf and I had a mini-discussion on grep and awk.
Here is a demo script that compares the awk and grep approaches for this single problem:
#!/usr/bin/env bash
# @(#) s2 Demonstrate group... (1 Reply)
Hello,
I have to fish out some specific columns from a file based on the header value. I have the list of columns I need in a different file. I thought I could read in the list of headers I need,
# file with header names of required columns in required order
headers_file=$2
# read contents... (11 Replies)
For those interested in installing dash shell on OSX Lion to help test POSIX compliancy of shell scripts, it is quite easy. I did it like this:
If you don't have gcc on your system:
0. Download and install the Command Line Tools for Xcode package from Sign In - Apple *
1. Download the dash... (2 Replies)
Hello and thanks in advance for any help anyone can offer me
I'm trying to learn the find command and thought I was understanding it... Apparently I was wrong. I was doing compound searches and I started getting weird results with the -size test. I was trying to do a search on a 1G file owned by... (14 Replies)
I have data of an excel files as given below,
file1
org1_1 1 1 2.5 100
org1_2 1 2 5.5 98
org1_3 1 3 7.2 88
file2
org2_1 1 1 2.5 100
org2_2 1 2 5.5 56
org2_3 1 3 7.2 70
I have multiple excel files as above shown.
I have to copy column 1, column 4 and paste into a new excel file as... (26 Replies)
Dear All,
Taking a break from Vue.js coding for the site, SEO and YT videos; and hopefully addressing some well deserved criticism from some here that I have been too focused on the visual aspects of the forums versus the substance and the community....
While the "current generation... (9 Replies)
Hi all...
Well guys and gals, I jumped in at the deep end and found things that PERL cannot do by default.
Many tricky terminal escape codes are not catered for so I had to create workarounds.
One thing I searched for was this:
Passing perl variable to shell command
AND, @Neo this was... (15 Replies)