]> icculus.org git repositories - duncan/yast2-ruby-bindings.git/blob - src/ruby/RubyLogger.cc
- Lot of fixes and support for the UI!!!
[duncan/yast2-ruby-bindings.git] / src / ruby / RubyLogger.cc
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                                                                      |
10 | ruby language support                              (C) Novell Inc.   |
11 \----------------------------------------------------------------------/
12
13 Author: Duncan Mac-Vicar <dmacvicar@suse.de>
14
15 This program is free software; you can redistribute it and/or
16 modify it under the terms of the GNU General Public License
17 as published by the Free Software Foundation; either version
18 2 of the License, or (at your option) any later version.
19
20 */
21
22 #include "RubyLogger.h"
23 #include <ycp/ExecutionEnvironment.h>
24
25 extern ExecutionEnvironment ee;
26
27 void
28 RubyLogger::error (string error_message)
29 {
30   y2_logger (LOG_ERROR,"Ruby",ee.filename ().c_str ()
31              ,ee.linenumber (),"","%s", error_message.c_str ());
32 }
33
34
35 void
36 RubyLogger::warning (string warning_message)
37 {
38   y2_logger (LOG_ERROR,"Ruby",ee.filename ().c_str ()
39              ,ee.linenumber (),"","%s", warning_message.c_str ());
40 }
41
42 RubyLogger*
43 RubyLogger::instance ()
44 {
45   if ( ! m_rubylogger )
46   {
47     m_rubylogger = new RubyLogger ();
48   }
49   return m_rubylogger;
50 }
51
52 RubyLogger* RubyLogger::m_rubylogger = NULL;