Ejemplo n.º 1
0
 public FileLogger(string categoryName, string filePath, FileLoggerConfiguration mConfiguration)
 {
     mFilePath           = Path.GetFullPath(filePath);
     this.mCategoryName  = categoryName;
     this.mFilePath      = filePath;
     this.mConfiguration = mConfiguration;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="path">The path to log to</param>
        /// <param name="configuration">The configuration to use</param>
        public FileLoggerProvider(string path, FileLoggerConfiguration configuration)
        {
            // Set the configuration
            mConfiguration = configuration;

            // Set the path
            mFilePath = path;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="categoryName">The category for this logger</param>
        /// <param name="filePath">The file path to write to</param>
        /// <param name="configuration">The configuration to use</param>
        public FileLogger(string categoryName, string filePath, FileLoggerConfiguration configuration)
        {
            // Get absolute path
            filePath = Path.GetFullPath(filePath);

            // Set members
            mCategoryName  = categoryName;
            mFilePath      = filePath;
            mConfiguration = configuration;
        }
Ejemplo n.º 4
0
 /// <summary>
 /// add a new file logger to the specific path
 /// </summary>
 /// <param name="builder"></param>
 /// <param name="path"></param>
 /// <returns></returns>
 public static ILoggingBuilder AddFile(this ILoggingBuilder builder, string path,
                                       FileLoggerConfiguration configuration = null)
 {
     if (configuration == null)
     {
         configuration = new FileLoggerConfiguration();
     }
     builder.AddProvider(new FileLoggerProvider(path, configuration));
     return(builder);
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Adds a new file logger to the specific path
        /// </summary>
        /// <param name="builder">The log builder to add to</param>
        /// <param name="path">The path where to write to</param>
        /// <returns></returns>
        public static ILoggingBuilder AddFile(this ILoggingBuilder builder, string path, FileLoggerConfiguration configuration = null)
        {
            // Create default configuration if not provided
            if (configuration == null)
            {
                configuration = new FileLoggerConfiguration();
            }

            // Add file log provider to builder
            builder.AddProvider(new FileLoggerProvider(path, configuration));

            // Return the builder
            return(builder);
        }
Ejemplo n.º 6
0
 public FileLoggerProvider(string path, FileLoggerConfiguration configuration)
 {
     mConfiguration = configuration;
     mFilePath      = path;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Default Constructor
 /// </summary>
 /// <param name="categoryName">The category for this logger</param>
 /// <param name="filepath">The file path to write to</param>
 /// <param name="configuration">The configuration to use</param>
 public FileLogger(string categoryName, string filepath, FileLoggerConfiguration configuration)
 {
     mCategoryName  = categoryName;
     mFilePath      = filepath;
     mConfiguration = configuration;
 }