C# 클래스 SIL.Utils.Logger

Logs stuff to a file created in c:\Documents and Settings\Username\Local Settings\Temp\Companyname\Productname\Log.txt
This class also has a rudimentary implementation of IStream. The only really implemented method is IStream.Write, the other methods of this interface are no-ops or throw a NotImplementedException.
상속: IFWDisposable, IStream
파일 보기 프로젝트 열기: sillsdev/FieldWorks 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
m_out System.CodeDom.Compiler.IndentedTextWriter

Private Properties

프로퍼티 타입 설명
ConvertByteToChar char
Dispose void
GetLogText string
InitializeTextWriter void
Logger System
WriteEventInternal void

공개 메소드들

메소드 설명
CheckDisposed ( ) : void

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.

Clone ( IStream &ppstm ) : void

Creates a new stream object with its own seek pointer that references the same bytes as the original stream.

Commit ( int grfCommitFlags ) : void

Ensures that any changes made to a stream object that is open in transacted mode are reflected in the parent storage.

CopyTo ( IStream pstm, long cb, IntPtr pcbRead, IntPtr pcbWritten ) : void

Copies a specified number of bytes from the current seek pointer in the stream to the current seek pointer in another stream.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Must not be virtual.

Init ( string projectName ) : void

Creates the logger. The logging functions can't be used until this method is called.

LockRegion ( long libOffset, long cb, int dwLockType ) : void

Restricts access to a specified range of bytes in the stream.

Read ( byte pv, int cb, IntPtr pcbRead ) : void

Reads a specified number of bytes from the stream object into memory starting at the current seek pointer.

Revert ( ) : void

Discards all changes that have been made to a transacted stream since the last M:System.Runtime.InteropServices.ComTypes.IStream.Commit(System.Int32) call.

Seek ( long dlibMove, int dwOrigin, IntPtr plibNewPosition ) : void

Changes the seek pointer to a new location relative to the beginning of the stream, to the end of the stream, or to the current seek pointer.

SetSize ( long libNewSize ) : void

Changes the size of the stream object.

ShutDown ( ) : void

Shut down the logger. The logging functions can't be used after this method is called.

Stat ( System &pstatstg, int grfStatFlag ) : void

Retrieves the structure for this stream.

UnlockRegion ( long libOffset, long cb, int dwLockType ) : void

Removes the access restriction on a range of bytes previously restricted with the method.

Write ( byte pv, int cb, IntPtr pcbWritten ) : void

Writes a specified number of bytes into the stream object starting at the current seek pointer.

WriteError ( Exception e ) : void

Writes an exception and its stack trace to the log. This method will do nothing if Init() is not called first.

WriteError ( string msg, Exception e ) : void

Writes msg and an exception and its stack trace to the log. This method will do nothing if Init() is not called first.

WriteEvent ( string message ) : void

Writes an event to the logger. This method will do nothing if Init() is not called first.

비공개 메소드들

메소드 설명
ConvertByteToChar ( byte b ) : char

Converts the byte to char.

Dispose ( bool disposing ) : void
GetLogText ( ) : string

Gets the log text.

InitializeTextWriter ( ) : void

Initializes (or reinitializes) the text writer.

Logger ( string logPrefix ) : System

Initializes a new instance of the Logger class.

WriteEventInternal ( string message ) : void

Writes the event to the logger.

메소드 상세

CheckDisposed() 공개 메소드

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.
public CheckDisposed ( ) : void
리턴 void

Clone() 공개 메소드

Creates a new stream object with its own seek pointer that references the same bytes as the original stream.
public Clone ( IStream &ppstm ) : void
ppstm IStream When this method returns, contains the new stream object. /// This parameter is passed uninitialized.
리턴 void

Commit() 공개 메소드

Ensures that any changes made to a stream object that is open in transacted mode are reflected in the parent storage.
public Commit ( int grfCommitFlags ) : void
grfCommitFlags int A value that controls how the changes for the stream /// object are committed.
리턴 void

CopyTo() 공개 메소드

Copies a specified number of bytes from the current seek pointer in the stream to the current seek pointer in another stream.
public CopyTo ( IStream pstm, long cb, IntPtr pcbRead, IntPtr pcbWritten ) : void
pstm IStream A reference to the destination stream.
cb long The number of bytes to copy from the source stream.
pcbRead System.IntPtr On successful return, contains the actual number of bytes /// read from the source.
pcbWritten System.IntPtr On successful return, contains the actual number of bytes /// written to the destination.
리턴 void

Dispose() 공개 메소드

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Must not be virtual.
public Dispose ( ) : void
리턴 void

Init() 공개 정적인 메소드

Creates the logger. The logging functions can't be used until this method is called.
public static Init ( string projectName ) : void
projectName string Name of the project that can be used (and certainly will /// be) to generate a unique log file name.
리턴 void

LockRegion() 공개 메소드

Restricts access to a specified range of bytes in the stream.
public LockRegion ( long libOffset, long cb, int dwLockType ) : void
libOffset long The byte offset for the beginning of the range.
cb long The length of the range, in bytes, to restrict.
dwLockType int The requested restrictions on accessing the range.
리턴 void

Read() 공개 메소드

Reads a specified number of bytes from the stream object into memory starting at the current seek pointer.
public Read ( byte pv, int cb, IntPtr pcbRead ) : void
pv byte When this method returns, contains the data read from the stream. /// This parameter is passed uninitialized.
cb int The number of bytes to read from the stream object.
pcbRead System.IntPtr A pointer to a ULONG variable that receives the actual number /// of bytes read from the stream object.
리턴 void

Revert() 공개 메소드

Discards all changes that have been made to a transacted stream since the last M:System.Runtime.InteropServices.ComTypes.IStream.Commit(System.Int32) call.
public Revert ( ) : void
리턴 void

Seek() 공개 메소드

Changes the seek pointer to a new location relative to the beginning of the stream, to the end of the stream, or to the current seek pointer.
public Seek ( long dlibMove, int dwOrigin, IntPtr plibNewPosition ) : void
dlibMove long The displacement to add to dwOrigin.
dwOrigin int The origin of the seek. The origin can be the beginning of /// the file, the current seek pointer, or the end of the file.
plibNewPosition System.IntPtr On successful return, contains the offset of the seek /// pointer from the beginning of the stream.
리턴 void

SetSize() 공개 메소드

Changes the size of the stream object.
public SetSize ( long libNewSize ) : void
libNewSize long The new size of the stream as a number of bytes.
리턴 void

ShutDown() 공개 정적인 메소드

Shut down the logger. The logging functions can't be used after this method is called.
public static ShutDown ( ) : void
리턴 void

Stat() 공개 메소드

Retrieves the structure for this stream.
public Stat ( System &pstatstg, int grfStatFlag ) : void
pstatstg System When this method returns, contains a STATSTG structure that /// describes this stream object. This parameter is passed uninitialized.
grfStatFlag int Members in the STATSTG structure that this method does not /// return, thus saving some memory allocation operations.
리턴 void

UnlockRegion() 공개 메소드

Removes the access restriction on a range of bytes previously restricted with the method.
public UnlockRegion ( long libOffset, long cb, int dwLockType ) : void
libOffset long The byte offset for the beginning of the range.
cb long The length, in bytes, of the range to restrict.
dwLockType int The access restrictions previously placed on the range.
리턴 void

Write() 공개 메소드

Writes a specified number of bytes into the stream object starting at the current seek pointer.
public Write ( byte pv, int cb, IntPtr pcbWritten ) : void
pv byte The buffer to write this stream to.
cb int The number of bytes to write to the stream.
pcbWritten System.IntPtr On successful return, contains the actual number of bytes /// written to the stream object. If the caller sets this pointer to null, this method /// does not provide the actual number of bytes written.
리턴 void

WriteError() 공개 정적인 메소드

Writes an exception and its stack trace to the log. This method will do nothing if Init() is not called first.
public static WriteError ( Exception e ) : void
e System.Exception
리턴 void

WriteError() 공개 정적인 메소드

Writes msg and an exception and its stack trace to the log. This method will do nothing if Init() is not called first.
public static WriteError ( string msg, Exception e ) : void
msg string
e System.Exception
리턴 void

WriteEvent() 공개 정적인 메소드

Writes an event to the logger. This method will do nothing if Init() is not called first.
public static WriteEvent ( string message ) : void
message string
리턴 void

프로퍼티 상세

m_out 보호되어 있는 프로퍼티

protected IndentedTextWriter,System.CodeDom.Compiler m_out
리턴 System.CodeDom.Compiler.IndentedTextWriter