GithubHelp home page GithubHelp logo

geosander / fme-logwriter Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 51 KB

Custom transformer for FME® that writes user-defined messages to the log

License: GNU General Public License v3.0

fme transformer custom-transformer logger

fme-logwriter's Introduction

FME® LogWriter

About

Logs user-defined messages to FME's log file, optionally preceded and/or followed by a line divider. If desired, the LogWriter can output a log feature that contains the following attributes:

_logwriter.level
_logwriter.message
_logwriter.time

Log features will be created if Create Log Features is set to anything else than No. You can use these features to write/push the (formatted) message to another file, a database or some web API for example. You can also use it in combination with a Terminator or it could serve as some kind of trigger feature within your workspace. The Write Log Message parameter influences when these features will be output.

Notes

  • Also available on FME Hub for convenient installation.
  • This transformer has been tested on Python 2.7 and 3.4.
  • Released under GNU General Public License v3.0.
  • If you notice a bug or desire a new feature, please contact me. Or make a pull request!
  • The test workspace is used for testing and provides some examples.

Usage

Write Log Message
Determines when the message will be logged. You can log right before each feature, or only before the first or directly after the last one that passes through the transformer. The latter is a nice option in case you want to print some kind of summary, for instance.
Note that this setting also influences the Create Log Features parameter, since log features will be created at the same time as the log message is written, but it will not influence the amount of features leaving the Output port: that should always be equal to the amount of input features.

Message Level
Specifies the "severity level" of the message you want to log. In FME Workbench, warnings will be logged in blue, (fatal) errors in red and all other types in black. Also, the message will be prefixed with the level accordingly (e.g. WARN, ERROR etc.), but this will only show up in the actual log file and not in FME's Translation Log window.

Create Log Features
When set to No (default), the LogMessages port will not be used. When set to Each Message, a feature will be created for each feature that was logged. Note that this setting depends on the Write Log Message setting, e.g. if After Last Feature was specified there, only 1 log feature will be output right after the last feature left the transformer.
The log feature stores the message level, text and time, similar to the LogMessageStreamer. See the overview section of this documentation for details.
When set to Each Message incl. Line(s), the message will include the Preceding Line and/or Succeeding Line set below.

Preceding Line
If desired, the message can be preceded by a blank/white line or a line divider (similar to FME's line style).
A line will be 75 characters long, which is the same length as FME's Logger uses, but 3 characters shorter than the line dividers FME prints at the end of the translation.

Log Message(s)
Specify the (multiline) text you want to log. You can type a static message, create a dynamic message using attribute values and workspace parameters or directly pass in the value of an attribute. Note that if your message consists of multiple lines, it will be split into separate lines in the log file.

Succeeding Line
If desired, the message can be succeeded by a blank/white line or line divider. See Preceding Line.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.