Skip to content

Commit 5841b2c

Browse files
committed
cvlib/context: Update docs for ctx.alog() no-op
Calling ctx.alog() in a studio template rendering context is a no-op. This is by design - there are no typical use cases for writing an audit log for potentially 1000s of devices during a CLI generation run. Studio developers are instead invited to use the ctx.info/warn etc. logging calls instead. Change-Id: I68338647bae99bd5cf57a4c0be8ab8e35a291b3c
1 parent ec2de81 commit 5841b2c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

cloudvision/cvlib/context.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
BUILD_ID_ARG,
3030
STUDIO_ID_ARG,
3131
STUDIO_IDS_ARG,
32-
WORKSPACE_ID_ARG,
3332
TIMEOUT_REQUEST,
33+
WORKSPACE_ID_ARG,
3434
)
3535
from .device import Device, Interface
3636
from .exceptions import (
@@ -734,6 +734,9 @@ def alog(self, message, userName=None, customKey=None, tags: Dict[str, str] = No
734734
The context's associated device name and id will be added to the audit log metadata
735735
if it is available in the context.
736736
737+
Note: This method is a no-op when run in a Studio template rendering context. Use the
738+
preferred ctx.info, ctx.error, ctx.debug etc. logging methods there instead.
739+
737740
Args:
738741
message: The string message for the audit log entry
739742
userName: The user to make the audit log entry under. If unspecified, will

0 commit comments

Comments
 (0)