Skip to content

Commit

Permalink
testing CmdLog4
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremytammik committed Aug 30, 2021
1 parent 35bb984 commit 7b97d97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
19 changes: 7 additions & 12 deletions BuildingCoder/BuildingCoder/CmdLog4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,16 @@ public static bool Initialised
get { return null != mainlogger; }
}

public static void InitMainLogger( string name )
public static void InitMainLogger( Type type )
{
//string name = type.ToString();

string name = type.ToString();
var repository = LogManager.CreateRepository( name );
mainlogger = LogManager.GetLogger( name, type );

//mainlogger = LogManager.GetLogger( name, type );

mainlogger = LogManager.GetLogger( name );

//string LogFilePath = Path.Combine(
// Environment.GetFolderPath( Environment.SpecialFolder.Personal ),
// "Company", "Product" + " " + 2022, "Log", "Revit.log" );

string LogFilePath = "C:/tmp/revit.log";
string LogFilePath = Path.Combine(
Environment.GetFolderPath( Environment.SpecialFolder.Personal ),
"Autodesk", "TbcSamples", "Log", "Revit.log" );

RollingFileAppender LogFile = new RollingFileAppender();
LogFile.File = LogFilePath;
Expand Down Expand Up @@ -134,7 +129,7 @@ public Result Execute(
// In a normal Revit add-in, this initialisation
// call might be placed in the OnStartup method.

Logger.InitMainLogger( "The_Building_Coder" );
Logger.InitMainLogger( typeof( CmdLog4 ) );
}

Logger.Log( new Exception( "sample exception" ) );
Expand Down
2 changes: 1 addition & 1 deletion BuildingCoder/BuildingCoder/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@
// 2021-08-18 2022.0.151.2 added CreateFloorAtElevation
// 2021-08-19 2022.0.151.3 integrated pull request #17 by @mmcpt fixing off-by-one error in CreateCurveLoop
// 2021-08-30 2022.0.151.4 eliminated deprecated API usage of NewFloor and NewSlab methods
// 2021-08-30 2022.0.152.0 test using Log4Net in a Revit add-in
// 2021-08-30 2022.0.152.0 implemented CmdLog4 to test using Log4Net in a Revit add-in
//
[assembly: AssemblyVersion( "2022.0.152.0" )]
[assembly: AssemblyFileVersion( "2022.0.152.0" )]

0 comments on commit 7b97d97

Please sign in to comment.