#include <Syslog.h>
Inheritance diagram for clawsoft::Syslog:
At the moment this class is very system dependent for the log types accepted, right now we are using the current C library implementation in your platform, under glibc it is an ORed combination of facility and level, the facility can be any one of:
LOG_AUTH security/authorization messages (DEPRECATED Use LOG_AUTHPRIV instead)
LOG_AUTHPRIV security/authorization messages (private)
LOG_CRON clock daemon (cron and at)
LOG_DAEMON system daemons without separate facility value
LOG_FTP ftp daemon
LOG_KERN kernel messages
LOG_LOCAL0 through LOG_LOCAL7 reserved for local use
LOG_LPR line printer subsystem
LOG_MAIL mail subsystem
LOG_NEWS USENET news subsystem
LOG_SYSLOG messages generated internally by syslogd
LOG_USER (default) generic user-level messages
LOG_UUCP UUCP Subsystem
These are the values for the level:
LOG_EMERG system is unusable
LOG_ALERT action must be taken immediately
LOG_CRIT critical conditions
LOG_ERR error conditions
LOG_WARNING warning conditions
LOG_NOTICE normal, but significant, condition
LOG_INFO informational message
LOG_DEBUG debug-level message
IN GLIBC THE ABOVE VALUES ARE DEFINED IN syslog.h
TODO:
Add portability for BSD based unices
verify that the glibc function syslog is reentrant
Public Methods | |
Syslog () | |
Default constructor. | |
void | getKernelInfo () |
This method will update the name and information about the current running kernel. | |
const char * | getUnixName () |
Use this method to retreives the name of the UNIX version you are currently using. | |
const char * | getNodeName () |
This method will give you the nodename of your current host machine. | |
const char * | getKernelRelease () |
This will return your current kernel release string. | |
const char * | getKernelReleaseVersion () |
This will return your current kernel release version string. | |
const char * | getHostMachine () |
This will return your current architecture description. | |
const char * | getClassName () |
Returns the name of the current class. | |
Static Public Methods | |
void | Log (const char *logmsg, int logtype=-666) |
This will append a new log message to the syslog daemon queue if you use the default logtype value it will use the facility LOG_USER and the priority LOG_INFO. | |
void | Log (const String &logmsg, int logtype=-666) |
This will append a new log message to the syslog daemon queue if you use the default logtype value it will use the facility LOG_USER and the priority LOG_INFO. | |
int | getuid () |
Obtains the current (running) user id. | |
int | getuid (const String &username) |
Obtain uid from username. | |
int | getgid () |
Obtains the current (running) user id. | |
int | getgid (const String &groupname) |
Obtain uid from username. | |
int | chown (const String &fname, int userid, int groupid=-1) |
Changes the owner of the file by its numeric userid. | |
int | chown (const String &fname, const String &owner) |
Changes the owner of the file by its username. | |
int | chgrp (const String &fname, int userid) |
Changes the group owner of the file by its numeric userid. | |
int | chgrp (const String &fname, const String &groupname) |
Changes the group owner of the file by its groupname. | |
int | installedCPUs () |
This will return how many CPUs are installed in the system. | |
double | cpuSpeed () |
This will return the CPU speed in megahertz. | |
int | totalMemory () |
Will return the total amount of system memory. | |
int | freeMemory () |
Will return the total amount of free system memory. | |
void | usleep (Uint32 usec) |
Will freeze the software for usec microseconds. | |
Protected Methods | |
void | setClassName (const char *n) |
Call this method when you need to set the name of the class you're creating, typically in it's constructor, remember that you must set the classname for every class you create, that way you can have more information while debugging. | |
Protected Attributes | |
char * | sysname |
Pointer to system name. |
|
Default constructor.
|
|
Changes the group owner of the file by its groupname.
|
|
Changes the group owner of the file by its numeric userid.
|
|
Changes the owner of the file by its username.
|
|
Changes the owner of the file by its numeric userid.
|
|
This will return the CPU speed in megahertz.
|
|
Will return the total amount of free system memory.
|
|
Returns the name of the current class.
|
|
Obtain uid from username.
|
|
Obtains the current (running) user id.
|
|
This will return your current architecture description.
|
|
This method will update the name and information about the current running kernel.
|
|
This will return your current kernel release string.
|
|
This will return your current kernel release version string.
|
|
This method will give you the nodename of your current host machine.
|
|
Obtain uid from username.
|
|
Obtains the current (running) user id.
|
|
Use this method to retreives the name of the UNIX version you are currently using.
|
|
This will return how many CPUs are installed in the system.
|
|
This will append a new log message to the syslog daemon queue if you use the default logtype value it will use the facility LOG_USER and the priority LOG_INFO.
|
|
This will append a new log message to the syslog daemon queue if you use the default logtype value it will use the facility LOG_USER and the priority LOG_INFO.
|
|
Call this method when you need to set the name of the class you're creating, typically in it's constructor, remember that you must set the classname for every class you create, that way you can have more information while debugging.
|
|
Will return the total amount of system memory.
|
|
Will freeze the software for usec microseconds.
|
|
Pointer to system name.
|
Authors:
Juan V. Guerrero
Jannette C. Mejia
Juan C. Guevara
Powered by: