Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
be88895
Removed VSCode Files
arisettisanjana Sep 21, 2022
b4507ec
AddedChecks
arisettisanjana Oct 19, 2022
69343cf
UpdatedForLoggingTheError
arisettisanjana Oct 21, 2022
d88f30e
UpdatedCode
arisettisanjana Oct 21, 2022
38d75dc
Revert "UpdatedCode"
arisettisanjana Oct 26, 2022
e643dd6
Revert "updated lsblk command by using more flags"
arisettisanjana Oct 26, 2022
752e627
reverting to master
arisettisanjana Oct 26, 2022
d3614c3
Merge branch 'Azure:master' into master
arisettisanjana Nov 21, 2022
f2a25a3
Merge branch 'Azure:master' into master
arisettisanjana Dec 1, 2022
7fbb0d1
Merge branch 'Azure:master' into master
arisettisanjana Dec 13, 2022
93f5171
Merge remote-tracking branch 'upstream/master'
arisettisanjana Dec 13, 2022
45b670d
Merge branch 'master' of https://github.com/arisettisanjana/azure-lin…
arisettisanjana Dec 13, 2022
6ee2ef7
Merge remote-tracking branch 'upstream/master'
arisettisanjana Feb 8, 2023
d32caeb
Merge branch 'Azure:master' into master
arisettisanjana Feb 13, 2023
5b5d7d1
Merge branch 'master' of https://github.com/arisettisanjana/azure-lin…
arisettisanjana Feb 13, 2023
6910c56
Merge remote-tracking branch 'upstream/master'
arisettisanjana Feb 21, 2023
f89bed4
Merge branch 'Azure:master' into master
arisettisanjana Feb 21, 2023
a3412dc
Merge branch 'master' of https://github.com/arisettisanjana/azure-lin…
arisettisanjana Feb 21, 2023
129c7a4
Merge remote-tracking branch 'upstream/master'
arisettisanjana Mar 9, 2023
0011cd4
removed sudo
arisettisanjana May 15, 2023
d89fbfd
Revert "removed sudo"
arisettisanjana May 15, 2023
085b60d
Merge branch 'Azure:master' into master
arisettisanjana May 15, 2023
6e02140
Merge branch 'master' of https://github.com/arisettisanjana/azure-lin…
arisettisanjana May 16, 2023
df94315
Merge branch 'Azure:master' into master
arisettisanjana May 29, 2023
7f5c965
Merge branch 'master' of https://github.com/arisettisanjana/azure-lin…
arisettisanjana May 29, 2023
937870d
Merge branch 'Azure:master' into master
arisettisanjana Jun 5, 2023
2381fe8
Merge branch 'master' of https://github.com/arisettisanjana/azure-lin…
arisettisanjana Jun 5, 2023
4a2a67d
Merge branch 'Azure:master' into master
arisettisanjana Jul 17, 2023
a351b1e
Merge branch 'master' of https://github.com/arisettisanjana/azure-lin…
arisettisanjana Jul 17, 2023
82dd260
Merge branch 'Azure:master' into master
arisettisanjana Sep 4, 2023
56053e9
Merge branch 'Azure:master' into master
arisettisanjana Sep 7, 2023
469cbfd
Merge branch 'Azure:master' into master
arisettisanjana Sep 19, 2023
fd13f36
Merge branch 'Azure:master' into master
arisettisanjana Sep 20, 2023
1a863f6
Merge branch 'Azure:master' into master
arisettisanjana Sep 22, 2023
93446a9
Merge branch 'Azure:master' into master
arisettisanjana Nov 16, 2023
3bf57c4
Merge branch 'Azure:master' into master
arisettisanjana Nov 17, 2023
821278c
Merge branch 'Azure:master' into master
arisettisanjana Dec 7, 2023
555ab2c
Merge branch 'Azure:master' into master
arisettisanjana Feb 1, 2024
57e700e
Merge branch 'Azure:master' into master
arisettisanjana Feb 8, 2024
56abd24
Merge branch 'Azure:master' into master
arisettisanjana May 16, 2024
7346668
Merge branch 'Azure:master' into master
arisettisanjana May 24, 2024
7a1f38b
Merge branch 'master' of https://github.com/arisettisanjana/azure-lin…
arisettisanjana May 25, 2024
783d01e
Merge branch 'Azure:master' into master
arisettisanjana Aug 30, 2024
471ef99
Merge branch 'master' of https://github.com/arisettisanjana/azure-lin…
arisettisanjana Aug 30, 2024
9dbc18f
Merge branch 'Azure:master' into master
arisettisanjana Sep 12, 2024
8960b53
Merge branch 'Azure:master' into master
arisettisanjana Sep 23, 2024
ed42f23
Merge branch 'master' of https://github.com/arisettisanjana/azure-lin…
arisettisanjana Sep 23, 2024
4ec7d00
Merge branch 'Azure:master' into master
arisettisanjana Oct 10, 2024
99597e8
Merge branch 'Azure:master' into master
arisettisanjana Oct 30, 2024
8a313dd
Merge branch 'Azure:master' into master
arisettisanjana Jan 9, 2025
4acf407
Merge branch 'Azure:master' into master
arisettisanjana Jan 21, 2025
5d901dd
Merge branch 'Azure:master' into master
arisettisanjana Feb 27, 2025
1a0c6ea
disabling console logging
Apr 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions VMBackup/main/backuplogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def __init__(self, hutil):
self.enforced_local_flag_value = True
self.hutil = hutil
self.prev_log = ''
#setting the ConsoleLoggingOff flag to true by default
self.console_logging_off = self.hutil.get_intvalue_from_configfile('ConsoleLoggingOff', 0)
self.logging_off = False

def enforce_local_flag(self, enforced_local):
Expand Down Expand Up @@ -68,25 +70,26 @@ def log(self, msg, local=False, level='Info'):
self.hutil.log(str(msg),level)

def log_to_con(self, msg):
try:
with open(self.con_path, "wb") as C :
message = "".join(list(filter(lambda x : x in string.printable, msg)))
C.write(message.encode('ascii','ignore'))
except IOError as e:
pass
except Exception as e:
pass
if self.console_logging_off != 0:
try:
with open(self.con_path, "wb") as C :
message = "".join(list(filter(lambda x : x in string.printable, msg)))
C.write(message.encode('ascii','ignore'))
except IOError as e:
pass
except Exception as e:
pass

def log_to_con_py3(self, msg, level='Info'):
def log_to_con_py3(self, msg, level='Info'):
log_msg = ""
try:
if type(msg) is not str:
msg = str(msg, errors="backslashreplace")
time = datetime.datetime.utcnow().strftime(u'%Y/%m/%d %H:%M:%S.%f')
log_msg = u"{0} {1} {2} \n".format(time , level , msg)
log_msg= str(log_msg.encode('ascii', "backslashreplace"),
encoding="ascii")
if(self.enforced_local_flag_value != False):
encoding="ascii")
if(self.enforced_local_flag_value != False and self.console_logging_off != 0):
with open(self.con_path, "w") as C :
C.write(log_msg)
except IOError:
Expand Down
2 changes: 1 addition & 1 deletion VMBackup/main/handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def main():
total_used_size = 0
size_calculation_failed = False
eventlogger = None
HandlerUtil.waagent.LoggerInit('/dev/console','/dev/stdout')
HandlerUtil.waagent.LoggerInit(None,'/dev/stdout')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might be better to add list of loggers to initialize in a config and pass those instead of checking specific config in backuplogger?

hutil = HandlerUtil.HandlerUtility(HandlerUtil.waagent.Log, HandlerUtil.waagent.Error, CommonVariables.extension_name)
backup_logger = Backuplogger(hutil)
MyPatching, patch_class_name, orig_distro = GetMyPatching(backup_logger)
Expand Down