aboutsummaryrefslogtreecommitdiffstats
path: root/logger.c
AgeCommit message (Collapse)AuthorFilesLines
2006-08-21merge new_loader_completion branch, including (at least):kpfleming1-914/+0
- restructured build tree and makefiles to eliminate recursion problems - support for embedded modules - support for static builds - simpler cross-compilation support - simpler module/loader interface (no exported symbols) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-08Merge team/russell/ast_verbose_threadstoragerussell1-225/+146
- instead of defining a free() wrapper in a bunch of files, define it as ast_free() in utils.h and remove the copies from all the files. - centralize and abstract the code used for doing thread storage. The code lives in threadstorage.h, with one function being implemented in utils.c. This new API includes generic thread storage as well as special functions for handling thread local dynamic length string buffers. - update ast_inet_ntoa() to use the new threadstorage API - update ast_state2str() to use the new threadstorage API - update ast_cli() to use the new threadstorage API - Modify manager_event() to use thread storage. Instead of using a buffer of 4096 characters as the workspace for building the manager event, use a thread local dynamic string. Now there is no length limitation on the length of the body of a manager event. - Significantly simplify the handling of ast_verbose() ... - Instead of using a static char buffer and a lock to make sure only one thread can be using ast_verbose() at a time, use a thread local dynamic string as the workspace for preparing the verbose message. Instead of locking around the entire function, the only locking done now is when the message has been built and is being deliviered to the list of registered verbose message handlers. - This function was doing a strdup() on every message passed to it and keeping a queue of the last 200 messages in memory. This has been completely removed. The only place this was used was that if there were any messages in the verbose queue when a verbose handler was registered, all of the messages in the queue would be fed to it. So, I just made sure that the console verbose handler and the network verbose handler (for remote asterisk consoles) were registered before any verbose messages. pbx_gtkconsole and pbx_kdeconsole will now lose a few verbose messages at startup, but I didn't feel the performance hit of this message queue was worth saving the initial verbose output for these very rarely used modules. - I have removed the last three arguments to the verbose handlers, leaving only the string itself because they aren't needed anymore. For example, ast_verbose had some logic for telling the verbose handler to add a newline if the buffer was completely full. Now that the buffer can grow as needed, this doesn't matter anymore. - remove unused function, ast_verbose_dmesg() which was to dispatch the message queue - Convert the list of verbose handlers to use the linked list macros. - add missing newline characters to a few ast_verbose() calls - convert the list of log channels to use the linked list macros in logger.c - fix close_logger() to close all of the files it opened for logging - update ast_log() to use a thread local dynamic string for its workspace for preparing log messages instead of a buffer of size BUFSIZ (8kB on my system) allocated on the stack. The dynamic string in this case is limited to only growing to a maximum size of BUFSIZ. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@39272 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-28As discussed and decided on the asterisk-dev mailing list ...russell1-2/+4
- Fix some breakage I introduced a while ago that made the timestamps option not functional for CLI verbose output. - Remove the use of the timestamps option for log output, since it was not functional. - clarify text referring to the timestamps option so that it is clear that it only applies to CLI verbose output git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38439 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-21slightly simplify a loop and replace an open coded version of ast_skip_blanksrussell1-7/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38068 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-09there is no reason to define our own 'maximum path length' when the POSIX ↵kpfleming1-2/+2
headers already define one for us git-svn-id: http://svn.digium.com/svn/asterisk/trunk@33351 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-07simplify autoconfig include mechanism (make tholo happy he can use lint ↵kpfleming1-4/+4
again :-) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32846 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-26Add ability to disable log / verbose output to remote consoles (issue #6524 ↵file1-2/+2
reported by mavetju) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@30603 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-24Merged revisions 30033 via svnmerge from file1-0/+2
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r30033 | file | 2006-05-24 16:14:01 -0300 (Wed, 24 May 2006) | 2 lines Fix deadlock caused by a race condition in the logger when reloading (issue #7195 reported and fixed by softins) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@30034 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-10remove almost all of the checks of the result from ast_strdupa() or alloca().russell1-4/+1
As it turns out, all of these checks were useless, because alloca will never return NULL. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@26451 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-08 use pid_t instead of long for pid variables. #7099 (casper)bweschke1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@25488 f38db490-d61c-443f-a65b-d21fe96a405b
2006-02-27conversions to allocation wrappers and coding guidelines fixes (issue #6592)russell1-21/+9
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@11232 f38db490-d61c-443f-a65b-d21fe96a405b
2006-02-26Merged revisions 11165 via svnmerge from tilghman1-97/+81
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r11165 | tilghman | 2006-02-26 10:26:39 -0600 (Sun, 26 Feb 2006) | 2 lines Bug 5950 - reenable queue log rotation; also, eliminate redundant code ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@11166 f38db490-d61c-443f-a65b-d21fe96a405b
2006-02-22use a symbolic constant instead of a magic number (tholo!)kpfleming1-3/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@10786 f38db490-d61c-443f-a65b-d21fe96a405b
2006-02-22Typo: should have been changed to a constanttilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@10784 f38db490-d61c-443f-a65b-d21fe96a405b
2006-02-15changed LOG_WARNING to LOG_DEBUG for backtracemogorman1-4/+4
messages (issue #6497) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@10195 f38db490-d61c-443f-a65b-d21fe96a405b
2006-02-08Merged revisions 9232 via svnmerge from mogorman1-2/+11
https://svn.digium.com/svn/asterisk/branches/1.2 ........ r9232 | mogorman | 2006-02-08 16:12:34 -0600 (Wed, 08 Feb 2006) | 4 lines Make logger report error,warning,notice if logger.conf not found, also updated chan_oss to give correct error message if its config file is not found. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@9239 f38db490-d61c-443f-a65b-d21fe96a405b
2006-01-20More doxygen updatesoej1-2/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8315 f38db490-d61c-443f-a65b-d21fe96a405b
2006-01-17Merged revisions 7963 via svnmerge from mogorman1-5/+5
https://svn.digium.com/svn/asterisk/branches/1.2 ........ r7963 | mogorman | 2006-01-10 22:38:07 -0600 (Tue, 10 Jan 2006) | 2 lines Minor typo refrenced in 6191 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8125 f38db490-d61c-443f-a65b-d21fe96a405b
2005-12-30update doxygen docs to specify authorsrussell1-0/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7682 f38db490-d61c-443f-a65b-d21fe96a405b
2005-12-27Bug 5183 - Inline stack backtracestilghman1-0/+36
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7646 f38db490-d61c-443f-a65b-d21fe96a405b
2005-12-04convert most of the option_*'s to a single ast_flags structure. Also, fix somerussell1-3/+3
formatting, remove some unnecessary casts, and other little code cleanups. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7331 f38db490-d61c-443f-a65b-d21fe96a405b
2005-11-29git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7221 ↵kpfleming1-0/+0
f38db490-d61c-443f-a65b-d21fe96a405b
2005-10-24Doxygen documentation update from oej (issue #5505)russell1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6847 f38db490-d61c-443f-a65b-d21fe96a405b
2005-10-05use thread ID instead of process ID in logger messages (issue #5349)kpfleming1-1/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6726 f38db490-d61c-443f-a65b-d21fe96a405b
2005-09-26ensure that if the verbose buffer is full, we send it out even if it's not ↵kpfleming1-0/+6
complete (issue #5263, patch modified to actually compile) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6662 f38db490-d61c-443f-a65b-d21fe96a405b
2005-09-15correct accidental logic reversalkpfleming1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6616 f38db490-d61c-443f-a65b-d21fe96a405b
2005-09-14clean up ast_verbose(), don't hold the lock any longer than neededkpfleming1-32/+42
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6606 f38db490-d61c-443f-a65b-d21fe96a405b
2005-09-14update MANY more files with proper copyright/license info (thanks Ian!)kpfleming1-6/+18
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6596 f38db490-d61c-443f-a65b-d21fe96a405b
2005-08-31make DEBUG_THREADS have more visible loggingkpfleming1-9/+8
make DEBUG_THREADS able to catch locks being unlocked by threads that did not own them add proper wrappers for pthread_cond_wait() and pthread_cond_timedwait() for DEBUG_THREADS mode git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6464 f38db490-d61c-443f-a65b-d21fe96a405b
2005-08-22add a LOG_DTMF logging channel and send all bridged DTMF events out that ↵kpfleming1-2/+12
channel (issue #4835) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6358 f38db490-d61c-443f-a65b-d21fe96a405b
2005-08-15Allow Asterisk to start even when eventlog is turned off (bug #4938)markster1-2/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6337 f38db490-d61c-443f-a65b-d21fe96a405b
2005-07-10more ast_copy_string conversionsrussell1-5/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6073 f38db490-d61c-443f-a65b-d21fe96a405b
2005-07-05ensure that filesize-triggered reloads don't recurse (bug #4621, with mods)kpfleming1-4/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6031 f38db490-d61c-443f-a65b-d21fe96a405b
2005-06-06more file version tagskpfleming1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5866 f38db490-d61c-443f-a65b-d21fe96a405b
2005-06-06remove experimental module version tagskpfleming1-1/+4
add per-file revision tags and 'show version files' CLI command git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5864 f38db490-d61c-443f-a65b-d21fe96a405b
2005-06-06major Makefile and build process improvements, including removal of all ↵kpfleming1-1/+0
hardcoded paths (modules must now use run-time paths as they should) (bug #4116) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5855 f38db490-d61c-443f-a65b-d21fe96a405b
2005-05-20clarify comments even morekpfleming1-5/+6
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5749 f38db490-d61c-443f-a65b-d21fe96a405b
2005-05-20add a little comment to keep someone else from having the same ↵kpfleming1-0/+6
misunderstanding I had :-) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5748 f38db490-d61c-443f-a65b-d21fe96a405b
2005-05-19Revert improper patch from bug #4294markster1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5744 f38db490-d61c-443f-a65b-d21fe96a405b
2005-05-19properly check for debug and verbose messages to suppress (bug #4294)kpfleming1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5726 f38db490-d61c-443f-a65b-d21fe96a405b
2005-05-14Fix logger check (bug #4260)markster1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5650 f38db490-d61c-443f-a65b-d21fe96a405b
2005-05-08Fix gethostname calls (bug #4198, with mods)markster1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5600 f38db490-d61c-443f-a65b-d21fe96a405b
2005-04-22phase 1 of header include cleanup (bug #4067)kpfleming1-7/+9
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5498 f38db490-d61c-443f-a65b-d21fe96a405b
2005-04-21use double-quotes instead of angle-brackets for non-system include files ↵kpfleming1-9/+9
(bug #4058) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5490 f38db490-d61c-443f-a65b-d21fe96a405b
2005-04-03fix obvious coding error from yesterday's fixkpfleming1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5369 f38db490-d61c-443f-a65b-d21fe96a405b
2005-04-02don't unnecessarily open-code strchr()kpfleming1-4/+3
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5361 f38db490-d61c-443f-a65b-d21fe96a405b
2005-04-01strip color code sequences from verbose messages being sent to files/syslog ↵kpfleming1-2/+36
(bug #3929, with mods) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5354 f38db490-d61c-443f-a65b-d21fe96a405b
2005-04-01Put syslog facility/level name into filename field, so it will show in ↵kpfleming1-88/+90
'logger show channels' (bug #3916) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5339 f38db490-d61c-443f-a65b-d21fe96a405b
2005-03-31Make logger respond better to lack of disk space and add "logger show ↵markster1-124/+197
channels" CLI (bug #3909 with minor mods) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5321 f38db490-d61c-443f-a65b-d21fe96a405b
2005-03-28No need for sizeof (bug #3887)markster1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5294 f38db490-d61c-443f-a65b-d21fe96a405b