1 // -*- c++ -*-
2 // Generated by assa-genesis
3 //------------------------------------------------------------------------------
4 // $Id: LogServer-main.cpp,v 1.3 2006/07/20 02:30:55 vlg Exp $
5 //------------------------------------------------------------------------------
6 //                            LogServer-main.cpp
7 //------------------------------------------------------------------------------
8 //  Copyright (c) 2003,2006 by Vladislav Grinchenko
9 //
10 //  This program is free software; you can redistribute it and/or
11 //  modify it under the terms of the GNU General Public License
12 //  as published by the Free Software Foundation; either version
13 //  2 of the License, or (at your option) any later version.
14 //------------------------------------------------------------------------------
15 //
16 // Date   : Thu Apr 17 17:31:20 2003
17 //
18 //------------------------------------------------------------------------------
19 
20 static const char help_msg[]=
21 "                                                                            \n"
22 " NAME:                                                                      \n"
23 "                                                                            \n"
24 "   assa-logd logging daemon                                                 \n"
25 "                                                                            \n"
26 " DESCRIPTION:                                                               \n"
27 "                                                                            \n"
28 "   Logging daemon from libASSA Programmer's Manual                          \n"
29 "                                                                            \n"
30 " USAGE:                                                                     \n"
31 "                                                                            \n"
32 "   shell>  assa-logd --port=PORT@HOST --monitor-port=PORT@HOST [OPTIONS]    \n"
33 "                                                                            \n"
34 " OPTIONS:                                                                   \n"
35 "                                                                            \n"
36 " -p, --port=NAME          - Applications traffic listening port             \n"
37 "                            (default: assalogd@localhost)                   \n"
38 " --monitor-port=PORT@HOST - Monitor clients listening port                  \n"
39 "                                                                            \n"
40 "                            (default: assalmon@localhost)                   \n"
41 " -b, --daemon=BOOL        - Run process as true UNIX daemon                 \n"
42 " -l, --pidfile=PATH       - The process ID is written to the lockfile PATH  \n"
43 "                            instead of default ~/.{procname}.pid            \n"
44 " -L, --ommit-pidfile=BOOL - Do not create PID lockfile                      \n"
45 "                                                                            \n"
46 " -D, --log-file=NAME      - Write debug to NAME file                        \n"
47 " -d, --log-stdout=BOOL    - Write debug to standard output                  \n"
48 " -z, --log-size=NUM       - Maximum size debug file can reach (dfl: is 10Mb)\n"
49 "     --log-dir=PATH       - Valid path to the store all the log files.      \n"
50 " -m, --mask=MASK          - Mask (default: ALL = 0x7fffffff)                \n"
51 "                                                                            \n"
52 " -n, --instance=NUM       - Process instance NUM (default - none)           \n"
53 " -f, --config-file=NAME   - Alternative configuration file NAME             \n"
54 "                                                                            \n"
55 " -h, --help               - Print this messag                               \n"
56 " -v, --version            - Print version number                            \n"
57 "                                                                            \n";
58 //------------------------------------------------------------------------------
59 
60 #include "LogServer-main.h"
61 #include "LogServer.h"
62 
63 int
main(int argc,char * argv[])64 main (int argc, char* argv[])
65 {
66     static const char release[] = "1.0.1";
67     int patch_level = 0;
68 
69     LOGSERVER->set_version (release, patch_level);
70     LOGSERVER->set_author  ("Vladislav Grinchenko");
71     LOGSERVER->set_flags   (ASSA::GenServer::RMLOG);
72 
73     LOGSERVER->init (&argc, argv, help_msg);
74 
75     LOGSERVER->init_service ();
76     LOGSERVER->process_events ();
77 
78     return LOGSERVER->get_exit_value ();
79 }
80