~ubuntu-branches/ubuntu/trusty/smuxi/trusty-proposed

« back to all changes in this revision

Viewing changes to lib/ServiceStack/src/ServiceStack.Interfaces/Logging/LogManager.cs

  • Committer: Package Import Robot
  • Author(s): Mirco Bauer
  • Date: 2013-05-25 22:11:31 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20130525221131-nd2mc0kzubuwyx20
Tags: 0.8.11-1
* [22d13d5] Imported Upstream version 0.8.11
* [6d2b95a] Refreshed patches
* [89eb66e] Added ServiceStack libraries to smuxi-engine package
* [848ab10] Enable Campfire engine
* [c6dbdc7] Always build db4o for predictable build result
* [13ec489] Exclude OS X specific libraries from dh_clideps

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
using ServiceStack.Logging.Support.Logging;
 
3
 
 
4
namespace ServiceStack.Logging
 
5
{
 
6
    /// <summary>
 
7
    /// Logging API for this library. You can inject your own implementation otherwise
 
8
    /// will use the DebugLogFactory to write to System.Diagnostics.Debug
 
9
    /// </summary>
 
10
    public class LogManager
 
11
    {
 
12
        private static ILogFactory logFactory;
 
13
 
 
14
        /// <summary>
 
15
        /// Gets or sets the log factory.
 
16
        /// Use this to override the factory that is used to create loggers
 
17
        /// </summary>
 
18
        /// <value>The log factory.</value>
 
19
        public static ILogFactory LogFactory
 
20
        {
 
21
            get
 
22
            {
 
23
                if (logFactory == null)
 
24
                {
 
25
                    return new DebugLogFactory();
 
26
                }
 
27
                return logFactory;
 
28
            }
 
29
            set { logFactory = value; }
 
30
        }
 
31
 
 
32
        /// <summary>
 
33
        /// Gets the logger.
 
34
        /// </summary>
 
35
        /// <param name="type">The type.</param>
 
36
        /// <returns></returns>
 
37
        public static ILog GetLogger(Type type)
 
38
        {
 
39
            return LogFactory.GetLogger(type);
 
40
        }
 
41
 
 
42
        /// <summary>
 
43
        /// Gets the logger.
 
44
        /// </summary>
 
45
        /// <param name="typeName">Name of the type.</param>
 
46
        /// <returns></returns>
 
47
        public static ILog GetLogger(string typeName)
 
48
        {
 
49
            return LogFactory.GetLogger(typeName);
 
50
        }
 
51
    }
 
52
}