Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auto-tx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vamp
auto-tx
Commits
d93d8a85
Commit
d93d8a85
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Include assembly information in startup messages.
parent
e42923f5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ATxService/AutoTx.cs
+21
-6
21 additions, 6 deletions
ATxService/AutoTx.cs
with
21 additions
and
6 deletions
ATxService/AutoTx.cs
+
21
−
6
View file @
d93d8a85
...
@@ -5,6 +5,7 @@ using System.Diagnostics;
...
@@ -5,6 +5,7 @@ using System.Diagnostics;
using
System.Linq
;
using
System.Linq
;
using
System.ServiceProcess
;
using
System.ServiceProcess
;
using
System.IO
;
using
System.IO
;
using
System.Reflection
;
using
System.Timers
;
using
System.Timers
;
using
ATxCommon
;
using
ATxCommon
;
using
ATxCommon.NLog
;
using
ATxCommon.NLog
;
...
@@ -274,12 +275,22 @@ namespace ATxService
...
@@ -274,12 +275,22 @@ namespace ATxService
/// Write a summary of loaded config + status to the log.
/// Write a summary of loaded config + status to the log.
/// </summary>
/// </summary>
private
void
StartupSummary
()
{
private
void
StartupSummary
()
{
var
msg
=
"Startup Summary:\n\n------ RoboSharp ------\n"
;
var
msg
=
"Startup Summary:\n\n"
;
var
roboDll
=
System
.
Reflection
.
Assembly
.
GetAssembly
(
typeof
(
RoboCommand
)).
Location
;
var
versionInfo
=
FileVersionInfo
.
GetVersionInfo
(
roboDll
);
var
assembly
=
Assembly
.
GetExecutingAssembly
();
msg
+=
" > DLL file: "
+
roboDll
+
"\n"
+
var
versionInfo
=
FileVersionInfo
.
GetVersionInfo
(
assembly
.
Location
);
" > DLL description: "
+
versionInfo
.
Comments
+
"\n"
+
msg
+=
"------ Assembly Information ------\n"
+
" > DLL version: "
+
versionInfo
.
FileVersion
+
"\n"
;
$" > version:
{
assembly
.
GetName
().
Version
}
\n"
+
$" > file version:
{
versionInfo
.
FileVersion
}
\n"
+
$" > description:
{
versionInfo
.
Comments
}
\n"
+
$" > version information:
{
versionInfo
.
ProductVersion
}
\n"
;
var
roboDll
=
Assembly
.
GetAssembly
(
typeof
(
RoboCommand
)).
Location
;
var
roboVersionInfo
=
FileVersionInfo
.
GetVersionInfo
(
roboDll
);
msg
+=
"\n------ RoboSharp ------\n"
+
$" > DLL location:
{
roboDll
}
\n"
+
$" > DLL description:
{
roboVersionInfo
.
Comments
}
\n"
+
$" > DLL file version:
{
roboVersionInfo
.
FileVersion
}
\n"
;
msg
+=
"\n------ Loaded status flags ------\n"
+
_status
.
Summary
()
+
msg
+=
"\n------ Loaded status flags ------\n"
+
_status
.
Summary
()
+
...
@@ -333,10 +344,14 @@ namespace ATxService
...
@@ -333,10 +344,14 @@ namespace ATxService
// read the build timestamp from the resources:
// read the build timestamp from the resources:
var
buildTimestamp
=
Properties
.
Resources
.
BuildDate
.
Trim
();
var
buildTimestamp
=
Properties
.
Resources
.
BuildDate
.
Trim
();
var
buildCommitName
=
Properties
.
Resources
.
BuildCommit
.
Trim
();
var
buildCommitName
=
Properties
.
Resources
.
BuildCommit
.
Trim
();
var
assembly
=
Assembly
.
GetExecutingAssembly
();
var
versionInfo
=
FileVersionInfo
.
GetVersionInfo
(
assembly
.
Location
);
Log
.
Info
(
"-----------------------"
);
Log
.
Info
(
"-----------------------"
);
Log
.
Info
(
"{0} service started."
,
ServiceName
);
Log
.
Info
(
"{0} service started."
,
ServiceName
);
Log
.
Info
(
"build: [{0}]"
,
buildTimestamp
);
Log
.
Info
(
"build: [{0}]"
,
buildTimestamp
);
Log
.
Info
(
"commit: [{0}]"
,
buildCommitName
);
Log
.
Info
(
"commit: [{0}]"
,
buildCommitName
);
Log
.
Info
(
"product version: [{0}]"
,
versionInfo
.
ProductVersion
);
Log
.
Info
(
"-----------------------"
);
Log
.
Info
(
"-----------------------"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment