summaryrefslogtreecommitdiffstats
path: root/src/vty/logging_vty.c
Commit message (Collapse)AuthorAgeFilesLines
* doxygen: enable AUTOBRIEF, drop \briefNeels Hofmeyr2017-06-231-1/+1
| | | | | | | | | | Especially for short descriptions, it is annoying to have to type \brief for every single API doc. Drop all \brief and enable the AUTOBRIEF feature of doxygen, which always takes the first sentence of an API doc as the brief description. Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87
* update/extend doxygen documentationHarald Welte2017-06-121-0/+12
| | | | | | | | | It's a pity that even with this patch we still are fare away from having the whole API documented. However, at least we have a more solid foundation. Updates not only extend the documentation, but also make sure it is rendered properly in the doxygen HTML. Change-Id: I1344bd1a6869fb00de7c1899a8db93bba9bafce3
* vty: cleanup logging functionsMax2017-05-091-3/+3
| | | | | | | | | | | | * remove unused parameter from logging_vty_add_cmds() * mark log level descriptors static * change internal static function int check_log_to_target() to more appropriate bool should_log_to_target() * deprecate log_vty_command_*() from public API as it should only be used by logging_vty_add_cmds() Change-Id: I0e9ddd7ba3ce211302d99a3494eb408907a2916e Related: OS#71
* fix spelling in API docu, command reply, logging, descriptionsThorsten Alteholz2017-04-231-1/+1
| | | | | | sections: ctrl, gb, gsm, vty Change-Id: Iac211b5cd8504da36b699777b95a2448dd7c3e70
* logging.h: fixup: shorter names for LOGGING_FILTER_* and LOGGING_CTX_*Neels Hofmeyr2017-02-231-2/+2
| | | | | | | | | | | | | | | My recent logging patch was merged to master a bit too soon. Accomodate the request for naming that matches the general "LOG" prefix instead of "LOGGING". libosmocore will not be backwards-compatible with the few commits from change-id I5c343630020f4b108099696fd96c2111614c8067 up to this one. This and following commits are backwards compatible with those before that short window. See also: * openbsc change-id Ib2ec5e4884aa90f48051ee2f832af557aa525991 * osmo-pcu change-id I4db4a668f2be07f3d55f848d38d1b490d8a7a685 Change-Id: I424fe3f12ea620338902b2bb8230544bde3f1a93
* logging: centrally define ctx and filter indexesNeels Hofmeyr2017-02-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | It is too easy for calling code to use the same filter and context indexes for different filters and structs. For example, openbsc's IMSI filter and libgb's GPRS_BVC filter both fall on index 1 even though there are plenty more indexes to choose from. To alleviate this, have one central definition here, sort of like ports.h does for VTY and CTRL port numbers. Add static asserts to make sure the indexes fit in the available array and bit mask space. Calling code like openbsc.git and osmo-pcu need adjustments and/or should move to using these enum values instead of their local definitions. Taking this opportunity to also prepare for a split of struct gsm_subscriber in openbsc into bsc_subsciber and vlr_subscriber with appropriate separate filter index constants for both subscriber types. Include previous LOG_FILTER_ALL in the LOGGING_FILTER_* enum, and replace its use by (1 << LOGGING_FILTER_ALL). Change-Id: I5c343630020f4b108099696fd96c2111614c8067
* Fix VTY: add missing doc for 'log gsmtap [HOSTNAME]'Neels Hofmeyr2016-12-111-1/+2
| | | | | | | | | Add missing doc string for the HOSTNAME arg. Added in commit aa00f99be2e4cc64ede20d8c9548b83054696581, this breaks the VTY tests for openbsc and hence breaks our jenkins build jobs. Change-Id: I734b22c950242541322e902887bf779c14ba10fd
* Implement GSMTAP log targetHarald Welte2016-12-091-0/+32
| | | | | | | This target wraps the to-be-logged string (With metadata) into a GSMTAP packet and sends it to the configured destination address. Change-Id: I9a7e72b8c9c6f6f2d76d1ea2332dcdee12394625
* vty: Skip printing non-initialized log categoriesDaniel Willmann2016-11-151-0/+3
| | | | | | | | | Without this patch the vty command show logging vty will cause a segfault if not all elements of the log_categories array are defined. Ticket: OW#3053 Sponsored-by: On-Waves ehf Change-Id: Ieeba649c3bde6c9376d8e32b00b92beb37c08ef2
* vty: Fix writing the logging of categoryMichael McTernan2015-03-201-1/+1
| | | | | Fix copy and paste issue introduced by Holger in 2d6ad13d8daf860595e6d4025861e122ce574871.
* vty: Fix typo in the state creationHolger Hans Peter Freyther2015-01-271-1/+1
| | | | | This got introduced in 2d6ad13d8daf860595e6d4025861e122ce574871 and I thought that our vty tests would have caught such mistakes.
* logging: Make it possible to print category/subsys and timestampsHolger Hans Peter Freyther2014-12-051-3/+46
| | | | | | | | | | | | We want to see from which category/subsystem a certain log message is coming from and use a different timestamp format as well. Add two new bitfields. This doesn't change the size of the structure and on 32bit we still have 27bits left. The extended timestamp will take preference over the current and default timestamp format. Fixes: SYS#602
* logging: Add ability to save/print current log filtersHarald Welte2014-08-251-2/+6
| | | | | | This enables the persistent configuration of let's say 'log filter imsi 012345678' for a given log file in the config file.
* vty: Add vty_install_default() and use for the vty nodesJacob Erlbeck2013-09-081-2/+1
| | | | | | | | | | | This adds the vty_install_default() function that is basically the install_default() function plus the registration of the commands 'exit' and 'end'. The latter is only provided in subnodes of ENABLED_NODE and CONFIG_NONE. The VTY test program is extended to check these commands. Ticket: OW#952
* vty: Fix logically dead code in the description handlingHolger Hans Peter Freyther2013-07-141-1/+1
| | | | | | | | | | The code most likely wanted to check the result of argv_concat. To do this we need to dereference the dptr. Logically dead code (DEADCODE) dead_error_line: Execution cannot reach this statement "return 1; Fixes: Coverity CID 1040675
* logging_vty: Fix segfault un unused entries in log_info_cat array of appHarald Welte2013-03-191-0/+4
|
* logging_vty: Print 'log filter all' info in 'show logging vty'Harald Welte2013-03-131-0/+6
| | | | | When we print information about the current logging configuration, it makes sense to also print information about the log filters.
* Added a ring buffer log target to store the last N log messages.Katerina Barone-Adesi2013-02-271-4/+81
| | | | | | | The log target can be used via log alarms and show alarms. Why? This feature was proposed/requested at http://openbsc.osmocom.org/trac/wiki/Tasks/ErrorLogTarget All messages use the same amount of space, prioritizing simplicity.
* Revert "Added a ring buffer log target to store the last N log messages."Holger Hans Peter Freyther2013-02-271-81/+4
| | | | | | | I noticed some more issues and it is the easiest to revert and include the fixed version. This reverts commit 73377229bb33ab79682ce4b126a63602d13304ad.
* Added a ring buffer log target to store the last N log messages.Katerina Barone-Adesi2013-02-271-4/+81
| | | | | | | The log target can be used via log alarms and show alarms. Why? This feature was proposed/requested at http://openbsc.osmocom.org/trac/wiki/Tasks/ErrorLogTarget All messages use the same amount of space, prioritizing simplicity.
* logging: Make sure to install standard "end" command in VTY nodeHarald Welte2012-10-221-0/+2
| | | | | When you are in the config-log VTY node, you expect "end" to work like in any other sub-node of config.
* logging: Don't forget to save "logging filter all 1"Harald Welte2012-10-221-0/+4
| | | | | | | Prior to this fix, a persistent file or syslog log configuration didn't work across an application re-start, as the "logging filter all 1" was never saved and thus no messages were logged.
* vty: Document the .TEXT of the descriptionHolger Hans Peter Freyther2012-07-251-1/+2
|
* vty: Provide documentation for all logging facilitiesHolger Hans Peter Freyther2011-10-031-1/+10
| | | | Document all facilities in the log syslog command.
* vty: Provide logging set-log-mask, deprecate set log maskHolger Hans Peter Freyther2011-10-031-2/+12
| | | | | | There are no other commands on the set, log and mask level, create a simple set-log-mask command and deprecate the old way.
* vty: Fix a memory leak in the vty description commandHolger Hans Peter Freyther2011-03-291-0/+2
| | | | | | Before assigning a new string, free the previous one. This assume that it was allocated with talloc which should be true for the osmocom users.
* include: reorganize headers file to include/osmocom/[gsm|core]Pablo Neira Ayuso2011-03-231-3/+3
| | | | | | | | | | | | This patch moves all GSM-specific definitions to include/osmocom/gsm. Moreover, the headers in include/osmocore/ have been moved to include/osmocom/core. This has been proposed by Harald Welte and Sylvain Munaunt. Tested with `make distcheck'. Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
* vty: integration with logging frameworkPablo Neira Ayuso2011-03-191-49/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logging categories are registered by the applications, like osmo-nitb, during startup. Thus, the VTY have to provide the logging commands according to the logging categories that the application has registered. Before this patch, the VTY contained the logging categories hardcoded. Thus, any change in the logging categories by the application would not be shown by the VTY. So far, this was not a problem because all applications used the same logging categories. However, according to what Harald told me, this may be a problem in the future. This patch resolve the lack of integration between the logging framework and the VTY by generating the VTY logging commands from the logging categories registered. Since this patch changes one function of the libosmocore API, it follows another patch for the openbsc application to get in sync with the new function layout. I have reworked and renamed the functions: * log_vty_category_string() * log_vty_level_string() to provide the new ones that generate the exact output that VTY requires. This patch does not release the memory allocated by talloc_zero_size() to store the VTY strings for the commands and the description. I found no exit function that can clean up resources that were allocated.
* LOGGING: Use host.app_info->name instead of FIXMEHarald Welte2011-02-241-1/+4
| | | | This should put a useful syslog identity in place.
* LOGGING: remove duplicated code between vty-logging and cfg-loggingHarald Welte2011-02-181-123/+60
|
* LOGGING: Add missing 'nat' subsystemHarald Welte2011-02-181-1/+2
|
* LOGGING: configure logging from the vtyHarald Welte2011-02-181-22/+355
| | | | | We can now configure logging to (multiple) files, stderr and syslog from the vty command line in a persistent way (config file)
* LOGGING: Pass the log level down to the log target output functionHarald Welte2011-02-171-1/+2
| | | | This will be required for mapping osmocore log levels to syslog priorities.
* logging: Add isup,m2ua,pcap from the cellmgr.Holger Hans Peter Freyther2011-01-221-1/+4
| | | | | This is something that we should generate dynamically from the log_info as well. This is adding bits from the cellmgr_ng.
* rename log_info to osmo_log_info to avoid namespace clash with appHarald Welte2010-05-251-2/+2
|
* Create libosmovty as library from OpenBSC VTY functionsHarald Welte2010-05-251-0/+347