summaryrefslogtreecommitdiff
path: root/include/asterisk/logger.h
AgeCommit message (Collapse)Author
2013-06-08Add backtrace generation to MALLOC_DEBUG memory corruption reportsMatthew Jordan
This patch allows astmm to access the backtrace generation code in Asterisk. When memory is allocated, a backtrace is created and stored with the memory region that tracks the allocation. If a memory corruption is detected, the backtrace is printed to the astmm log. The backtrace will make use of the BETTER_BACKTRACES build option if available. As a result, this patch moves the backtrace generation code into its own file and uses the non-wrapped versions of the C library memory allocation routines. This allows the memory allocation code to safely use the backtrace generation routines without infinitely recursing. Review: https://reviewboard.asterisk.org/r/2567 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-15Stopped spamming of debug messages during attended transfer.Kevin Harwell
While autoservice is running and servicing a channel the callid is being stored and removed in the thread's local storage for each iteration of the thread loop. If debug was set to a sufficient level the log file would be spammed with callid thread local storage debug messages. Added a new function that checks to see if the callid to be stored is different than what is already contained (if anything). If it is different then store/replace and log, otherwise just leave as is. Also made it so all logging of debug messages pertaining to the callid thread storage outputs only when TEST_FRAMEWORK is defined. (issue ASTERISK-21014) (closes issue ASTERISK-21014) Report by: Rusty Newton Review: https://reviewboard.asterisk.org/r/2324/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-26Unique Call ID logging Phases III and IVJonathan Rose
Adds call ID logging changes to specific channel drivers that weren't handled handled in phase II of Call ID Logging. Also covers logging for threads for threads created by systems that may be involved with many different calls. Extra special thanks to Richard for rigorous review of chan_dahdi and its various signalling modules. review: https://reviewboard.asterisk.org/r/1927/ review: https://reviewboard.asterisk.org/r/1950/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-17logger: Adds additional support for call id logging and chan_sip specific stuffJonathan Rose
This patch improves the handling of call id logging significantly with regard to transfers and adding APIs to better handle specific aspects of logging. Also, changes have been made to chan_sip in order to better handle the creation of callids and to enable the monitor thread to bind itself to a particular call id when a dialog is determined to be related to a callid. It then unbinds itself before returning to normal monitoring. review: https://reviewboard.asterisk.org/r/1886/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366842 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29Introducing the log message unique call identifiers featureJonathan Rose
Log messages will now display a call number that they are tied to (ordered for calls based on when they started). This feature is made to be minimally invasive without requiring changes to many of the existing log messages. These IDs won't show up for verbose messages on CLI (but they will in log files) This is currently in phase II of production, see more about this feature on the wiki -- https://wiki.asterisk.org/wiki/display/AST/Unique+Call-ID+Logging Review: https://reviewboard.asterisk.org/r/1823/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29undoing 360785 due to merging mistakeJonathan Rose
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29Introducing the log message unique call identifiers featureJonathan Rose
Log messages will now display a call number that they are tied to (ordered for calls based on when they started). This feature is made to be minimally invasive without requiring changes to many of the existing log messages. These IDs won't show up for verbose messages on CLI (but they will in log files) This is currently in phase II of production, see more about this feature on the wiki -- https://wiki.asterisk.org/wiki/display/AST/Unique+Call-ID+Logging Review: https://reviewboard.asterisk.org/r/1823/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-14Fix bogus reads/writes of console log levels in asterisk.c Russell Bryant
This patch updates the NUMLOGLEVELS define in logger.h to 32, to match the fact that logger.c implements 32 log levels (because of the custom log level stuff). asterisk.c uses this define to size an array of levels per remote console. This array is modified in ast_console_toggle_loglevel(), which is called by the "logger set level" CLI command. While the documentation for the CLI command doesn't make it terribly obvious, you can use this CLI command to toggle a custom log level on a remote console, as well. However, doing so led to an invalid array index in asterisk.c. This array is read from any time a log message is written to a console. So, all custom log level messages resulted in a bogus read if a remote console was connected. ........ Merged revisions 359259 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 359260 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-14Re-commit the verbose branch.Tilghman Lesher
This change permits each verbose destination (consoles, logger) to have its own concept of what the verbosity level is. The big feature here is that the logger will now be able to capture a particular verbosity level without condemning each console to need to suffer that level of verbosity. Additionally, a stray 'core set verbose' will no longer change what will go to the log. Review: https://reviewboard.asterisk.org/r/1599/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-12Backed out core changes from r346391Matthew Jordan
During testing, it was discovered that there were a number of side effects introduced by r346391 and subsequent check-ins related to it (r346429, r346617, and r346655). This included the /main/stdtime/ test 'hanging', as well as the remote console option failing to receive the appropriate output after a period of time. I only backed out the changes to main/ and utils/, as this was adequate to reverse the behavior experienced. (issue ASTERISK-18974) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-29Allow each logging destination and console to have its own notion of the ↵Tilghman Lesher
verbosity level. Review: https://reviewboard.asterisk.org/r/1599 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-22Clarify why the AST_LOG_* macros exist next to the LOG_* macros.Walter Doekes
(issue ASTERISK-17973) ........ Merged revisions 345923 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 345924 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-28Merged revisions 338253 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r338253 | rmudgett | 2011-09-28 16:22:05 -0500 (Wed, 28 Sep 2011) | 14 lines Merged revisions 338235 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r338235 | rmudgett | 2011-09-28 16:17:45 -0500 (Wed, 28 Sep 2011) | 7 lines Fix inconsistency in LOG_VERBOSE/AST_LOG_VERBOSE declaration. (closes issue ASTERISK-17973) Reported by: Luke H Patches: logger_h.patch (license #6278) patch uploaded by Luke H ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@338284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-24Merged revisions 324768 via svnmerge from Jonathan Rose
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r324768 | jrose | 2011-06-24 11:48:06 -0500 (Fri, 24 Jun 2011) | 11 lines DTMF wasn't being logged on connected consoles when enabled in logger.conf Previously in order for DTMF to be logged in a connected console session, the user would have to do logger set channel DTMF on. This corrects that so that it is on by default. This issue was caused by an off by one error incurred by a logger level count of 6 in logger.h where it should have been 7. (closes issue: ASTERISK-17974) Reported by: Luke H ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@324769 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-06Merged revisions 322069 via svnmerge from Jonathan Rose
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r322069 | jrose | 2011-06-06 14:07:56 -0500 (Mon, 06 Jun 2011) | 8 lines Fixes level toggling for logger set levels since it was reversed (closes issue ASTERISK-17850) Reported by: Luke H Tested by: jrose, Luke H Review: https://reviewboard.asterisk.org/r/1244/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@322070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-18Merged revisions 298960 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r298960 | tilghman | 2010-12-17 17:52:04 -0600 (Fri, 17 Dec 2010) | 20 lines Merged revisions 298957 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r298957 | tilghman | 2010-12-17 17:30:55 -0600 (Fri, 17 Dec 2010) | 13 lines Merged revisions 298905 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r298905 | tilghman | 2010-12-17 15:40:56 -0600 (Fri, 17 Dec 2010) | 6 lines Let Asterisk find better backtrace information with libbfd. The menuselect option BETTER_BACKTRACES, if enabled, will use libbfd to search for better symbol information within both the Asterisk binary, as well as loaded modules, to assist when using inline backtraces to track down problems. Review: https://reviewboard.asterisk.org/r/1055/ ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@298961 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-08Fix some doxygen warnings.Leif Madsen
(closes issue #17336) Reported by: snuffy Patches: doxygen-fixes1.diff uploaded by snuffy (license 35) Tested by: russell git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268969 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-23Change per-file debug and verbose levels to be per-module, the wayKevin P. Fleming
users expect them to work. 'core set debug' and 'core set verbose' can optionally change the level for a specific filename; however, this is actually for a specific source file name, not the module that source file is included in. With examples like chan_sip, chan_iax2, chan_misdn and others consisting of multiple source files, this will not lead to the behavior that users expect. If they want to set the debug level for chan_sip, they want it set for all of chan_sip, and not to have to also set it for reqresp_parser and other files that comprise the chan_sip module. This patch changes this functionality to be module-name based instead of file-name based. To make this work, some Makefile modifications were required to ensure that the AST_MODULE definition is present in each object file produced for each module as well. Review: https://reviewboard.asterisk.org/r/574/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-21Change all refererences to 1.6.3 to be 1.8, since that will be the next ↵Kevin P. Fleming
feature release git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-15Add ability for modules to dynamically register logger levelsKevin P. Fleming
This patch adds the ability for modules to dynamically create logger levels for their own use; these are named levels just like the built-in levels, and can be directed to any destination that the logger can send any level to, by including their names in logger.conf. Review: https://reviewboard.asterisk.org/r/244/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-02Remove rarely-used event_log/LOG_EVENT supportKevin P. Fleming
In discussions today at the Europe Asterisk Developer Meet-Up, we determined that the event_log was used in only 9 places in the entire tree, and really was not needed at all. The users have been converted to use LOG_NOTICE, or the messages have been removed since other messages were already in place that provided the same information. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-10revert addition of LOG_SECURITY log channel; after further discussion, a ↵Kevin P. Fleming
much better solution will be used git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187636 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09add a dedicated log channel for modules to be able report security-related ↵Kevin P. Fleming
events, so that they can be fed into external processes for analysis and possible mitigation efforts (inspired by this evening's Toronto Asterisk Users Group meeting and previous dicussions amongst various community members) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-09Add Doxygen documentation for API changes from 1.6.0 to 1.6.1Jeff Peeler
Copied from my review board description: This is a continuation of the API changes documentation started for describing changes between releases. Most of the API changes were pretty simple needing only to be brought to attention via the new "Asterisk API Changes" list. However, if you see anything that needs further explanation feel free to supplement what is there. The current method of documenting is to add (in the header file): \version <ver number> <description of changes> and then to add the function to the change list in doxyref.h on the AstAPIChanges page. I also made sure all the functions that were newly added were tagged with \since 1.6.1. I think this is a good habit to start both for the historical aspect as well as for the future ability to easily add a "New Asterisk API" page. Review: http://reviewboard.digium.com/r/190/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@180719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-29incorporates r159808 from branches/1.4:Kevin P. Fleming
------------------------------------------------------------------------ r159808 | kpfleming | 2008-11-29 10:58:29 -0600 (Sat, 29 Nov 2008) | 7 lines update dev-mode compiler flags to match the ones used by default on Ubuntu Intrepid, so all developers will see the same warnings and errors since this branch already had some printf format attributes, enable checking for them and tag functions that didn't have them format attributes in a consistent way ------------------------------------------------------------------------ in addition: move some format attributes from main/utils.c to the header files they belong in, and fix up references to the relevant functions based on new compiler warnings git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@159818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-19Starting with a change to ensure that ast_verbose() preserves ABI compatibilityTilghman Lesher
in 1.6.1 (as compared to 1.6.0 and versions of 1.4), this change also deprecates the use of Asterisk with FreeBSD 4, given the central use of va_copy in core functions. va_copy() is C99, anyway, and we already require C99 for other purposes, so this isn't really a big change anyway. This change also simplifies some of the core ast_str_* functions. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-02Fix a bunch of places where \arg was used instead of \param. Using \argRussell Bryant
to document arguments seems logical, and does work, but is not the best thing to use. \arg in doxygen is simply for creating non-nested unordered lists. \param is the correct tag to use to document function parameters, and will come out better in the generated documentation. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19Detect if the installed gcc version supports the warn_unused_result attribute.Tilghman Lesher
Reported by mvanbaak via IRC -dev. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29Adds support for changing logger settingss on remote consoles with a Brett Bryant
new command "logger set level". i.e. "logger set level debug off" (closes issue #10891) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-23A new feature thanks to the fine folks at Switchvox!Mark Michelson
If a deadlock is detected, then the typical lock information will be printed along with a backtrace of the stack for the offending threads. Use of this requires compiling with DETECT_DEADLOCKS and having glibc installed. Furthermore, issuing the "core show locks" CLI command will print the normal lock information as well as a backtraces for each lock. This requires that DEBUG_THREADS is enabled and that glibc is installed. All the backtrace features may be disabled by running the configure script with --without-execinfo as an argument git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21This change makes it so that logs will report the correct source of verbose ↵Mark Michelson
messages. Until this change, all verbose messages in Asterisk's log files reported logger.c as the source of the message. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-02Add attributes to various API calls, to help track down bugs (and remove a ↵Tilghman Lesher
deprecated function) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115157 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23Round 2 of IMAP_STORAGE app_voicemail.c fixes:Mark Michelson
This fixes a bug that was thought to be fixed already. app_voicemail, if using IMAP_STORAGE, has a problem because the IMAP header files include syslog.h, which define LOG_WARNING and LOG_DEBUG to be different than what Asterisk uses for those same macros. This was "fixed" in the past by including all the IMAP header files prior to including asterisk.h. This fix worked... unless you were to try to compile with MALLOC_DEBUG. MALLOC_DEBUG prepends the inclusion of astmm.h to every file, which means that no matter what order the includes are in in app_voicemail, the unexpected values for LOG_WARNING and LOG_DEBUG will be in place. The action taken for this fix was to define AST_LOG_* macros in addition to the LOG_* macros already defined. These new macros are used in app_voicemail.c, logger.h, and astobj.h right now, and their use will be encouraged in the future. In consideration of those who have written third-party modules which use the LOG_* macros, these will NOT be removed from the source, however future use of these macros is discouraged. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114577 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-16Standardized routines for forking processes (keeps all the specialized code ↵Tilghman Lesher
in one place). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-14Changed VERBOSITY_LEVEL to VERBOSITY_ATLEAST to be more accurate.Mark Michelson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-14After reading Russell's e-mail to the dev list stating that checking ↵Mark Michelson
option_verbose is not equivalent to the check done by ast_verb, I wrote a macro, VERBOSITY_LEVEL, which does this check. I did a quick look in the source and used this macro in some places where option_verbose was used. I also converted some verbose messages in logger.c to use ast_verb instead of ast_verbose. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-11A lot of doxygen updatesOlle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92285 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-06Merged revisions 91366 via svnmerge from Olle Johansson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r91366 | oej | 2007-12-06 13:54:11 +0100 (Tor, 06 Dec 2007) | 4 lines Make sure logger is reloaded at general reload in the cli. (Discovered during Asterisk training in Portugal) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19revert inclusion of options.hLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89412 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16logger.h does not need options.hLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16Start untangling header inclusion in a way that does not affectLuigi Rizzo
build times - tested, there is no measureable difference before and after this commit. In this change: use asterisk/compat.h to include a small set of system headers: inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h, stdlib.h, alloca.h, stdio.h Where available, the inclusion is conditional on HAVE_FOO_H as determined by autoconf. Normally, source files should not include any of the above system headers, and instead use either "asterisk.h" or "asterisk/compat.h" which does it better. For the time being I have left alone second-level directories (main/db1-ast, etc.). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-13Merged revisions 85533 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r85533 | russell | 2007-10-13 01:48:10 -0400 (Sat, 13 Oct 2007) | 12 lines Fix an issue with console verbosity when running asterisk -rx to execute a command and retrieve its output. The issue was that there was no way for the main Asterisk process to know that the remote console was connecting in the -rx mode. The way that James has fixed this is to have all remote consoles muted by default. Then, regular remote consoles automatically execute a CLI command to unmute themselves when they first start up. (closes issue #10847) Reported by: atis Patches: asterisk-consolemute.diff.txt uploaded by jamesgolovich (license 176) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85534 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-04logger.h depends on options.h, so go ahead and include itRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23(closes issue #10192)Russell Bryant
Reported by: bbryant Patches: 20070720__core_debug_by_file.patch uploaded by bbryant (license 36) (with some modifications by me) Tested by: russell, bbryant This set of changes introduces the ability to set the core debug or verbose levels on a per-file basis. Interestingly enough, in 1.4, you have the ability to set core debug for a single file, but that functionality was accidentally lost in the conversion of the CLI commands to the new format. This patch improves upon what was in 1.4 by letting you set it for more than 1 file, and by also supporting verbose. *** Janitor Project *** This patch also introduces a new macro, ast_verb(), which is similar to ast_debug(). Setting the per file verbose value only works for messages that use this macro. Converting existing uses of ast_verbose() can be done like: if (option_debug > 2) ast_verbose(VERBOSE_PREFIX_3 "Something useful\n"); ... ast_verb(3, "Something useful\n"); git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76555 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-12Put parenthesis around the level argument to ast_debug()Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-12Add a new macro, ast_debug(), which combines the check of the value ofRussell Bryant
option_debug and the actual call to ast_log(). (issue #9925, dimas) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@68987 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28Merged revisions 43933 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r43933 | file | 2006-09-28 14:05:43 -0400 (Thu, 28 Sep 2006) | 2 lines Put in missing \ns on the end of ast_logs (issue #7936 reported by wojtekka) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-08Merge team/russell/ast_verbose_threadstorageRussell Bryant
- 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: https://origsvn.digium.com/svn/asterisk/trunk@39272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-05-26Fix various problems in the addition of the ability to mute log/verboseRussell Bryant
output to remove consoles. The prototypes added to logger.h still need doxygen documentation, as well. - Add the new command line option to the man page - make the mute option a flag instead of an int since it is only a binary option - remove useless extern keywords for prototypes added to logger.h - rename ast_console_mute() to ast_console_toggle_mute() since that is what it actually does - actually apply the mute option to newly created remote consoles instead of only working when the CLI command is used - don't imply the NO_FORK option if the mute command line option is provided - place the new CLI command in the correct place in the list which has to be in alphabetical order - Finally, clean up a few spacing issues to conform to the coding guidelines git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@30630 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-05-26Add ability to disable log / verbose output to remote consoles (issue #6524 ↵Joshua Colp
reported by mavetju) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@30603 65c4cc65-6c06-0410-ace0-fbb531ad65f3