]> git.sesse.net Git - vlc/blob - modules/misc/logger.c
vlc_plugin: fix non-LGPL plugins meta infos
[vlc] / modules / misc / logger.c
1 /*****************************************************************************
2  * logger.c : file logging plugin for vlc
3  *****************************************************************************
4  * Copyright (C) 2002-2008 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Samuel Hocevar <sam@zoy.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27
28 #ifdef HAVE_CONFIG_H
29 # include "config.h"
30 #endif
31
32 #define VLC_MODULE_LICENSE VLC_LICENSE_GPL_2_PLUS
33 #include <vlc_common.h>
34 #include <vlc_plugin.h>
35 #include <vlc_interface.h>
36
37 #include <stdarg.h>
38
39 /*****************************************************************************
40  * Local prototypes
41  *****************************************************************************/
42 static int  Open    ( vlc_object_t * );
43 static void Close   ( vlc_object_t * );
44
45 /*****************************************************************************
46  * Module descriptor
47  *****************************************************************************/
48 vlc_module_begin ()
49     set_shortname( N_( "Logging" ) )
50     set_description( N_("File logging") )
51
52     set_category( CAT_ADVANCED )
53     set_subcategory( SUBCAT_ADVANCED_MISC )
54
55     add_obsolete_string( "rrd-file" )
56
57     set_capability( "interface", 0 )
58     set_callbacks( Open, Close )
59 vlc_module_end ()
60
61 /*****************************************************************************
62  * Open: initialize and create stuff
63  *****************************************************************************/
64 static int Open( vlc_object_t *p_this )
65 {
66     intf_thread_t *p_intf = (intf_thread_t *)p_this;
67
68     msg_Err( p_intf, "The logger interface no longer exists." );
69     msg_Info( p_intf, "As of VLC version 0.9.0, use --file-logging to write "
70               "logs to a file." );
71 # ifndef _WIN32
72     msg_Info( p_intf, "Use --syslog to send logs to the system logger." );
73 # endif
74     return VLC_EGENERIC;
75 }
76
77 /*****************************************************************************
78  * Close: destroy interface stuff
79  *****************************************************************************/
80 static void Close( vlc_object_t *p_this )
81 {
82     /* Flush the queue and unsubscribe from the message queue */
83     vlc_LogSet( p_this->p_libvlc, NULL, NULL );
84 }