02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

PetrelLogger Class<br />

define a message category source to use the listener for messages that are tagged with<br />

MyCategory.<br />

Debug Messages<br />

PetrelLogger provides two methods that create debug messages, Debug and<br />

DebugPublic. These methods write their output to the log file and the output window<br />

of Visual Studio. The Debug method message is intended only for developers of the<br />

component issuing the message. DebugPublic will issue the message to any component<br />

that is using your subsystem.<br />

Exception e;<br />

PetrelLogger.Debug (“Testing component”, e);<br />

PetrelLogger.DebugPublic(“Testing component. Message to everyone”, e);<br />

Status Bar<br />

The status bar in the Petrel application shell informs the user about current processing<br />

status. PetrelLogger has four methods that display messages in the Petrel status bar.<br />

The method used determines the icon displayed at the right end of the status bar that<br />

indicates the severity of the message. Each method takes a single string as its argument.<br />

using Slb.<strong>Ocean</strong>.Petrel;<br />

public sealed class PetrelLogger : CoreLogger<br />

{<br />

static void Status (string message);<br />

static void SuccessStatus (string message);<br />

static void ErrorStatus (string message);<br />

static void WarningStatus (string message);<br />

...<br />

}<br />

Use PetrelLogger to set the text in the status bar. The icon in the status bar is set<br />

automatically based on the type of information displayed. SuccessStatus displays an<br />

5-248 <strong>Ocean</strong> Application Development Framework 2008.1<br />

<strong>Schlumberger</strong> Private

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!